Skip to content

Commit c0ffa23

Browse files
committed
Add the ability to organize rules
1 parent 5fc7db0 commit c0ffa23

File tree

10 files changed

+4002
-29
lines changed

10 files changed

+4002
-29
lines changed

.github/workflows/get-version.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
var fs = require('fs');
2+
console.log(JSON.parse(fs.readFileSync('module.json', 'utf8')).version);

.github/workflows/main.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Custom CSS CI/CD
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
11+
# create a zip file with all files required by the module to add to the release
12+
- run: zip -r ./module.zip module.json laguages/ scripts/libs/ custom-css.css custom-css.js settings.js settingsForm.js
13+
14+
# Get the version from 'module.json'
15+
- name: Get Version
16+
shell: bash
17+
id: get-version
18+
run: echo "::set-output name=version::$(node ./.github/workflows/get-version.js)"
19+
20+
# Create a release for this specific version
21+
- name: Create Release
22+
id: create_version_release
23+
uses: ncipollo/release-action@v1
24+
with:
25+
allowUpdates: true # set this to false if you want to prevent updating existing releases
26+
name: Release ${{ steps.get-version.outputs.version }}
27+
draft: false
28+
prerelease: false
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
artifacts: './module.json,./module.zip'
31+
tag: ${{ steps.get-version.outputs.version }}
32+
33+
# Update the 'latest' release
34+
- name: Create Release
35+
id: create_latest_release
36+
uses: ncipollo/release-action@v1
37+
if: endsWith(github.ref, 'master')
38+
with:
39+
allowUpdates: true
40+
name: Latest
41+
draft: false
42+
prerelease: false
43+
token: ${{ secrets.GITHUB_TOKEN }}
44+
artifacts: './module.json,./module.zip'
45+
tag: latest

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
![](https://img.shields.io/badge/Foundry-v0.6.0-informational)
2-
[![](https://img.shields.io/badge/FoundryGet-compatible-success)](https://github.com/cswendrowski/foundryget)
32
[![](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-%243-orange)](https://www.buymeacoffee.com/T2tZvWJ)
43

54

@@ -14,10 +13,8 @@ Allows a user to setup custom CSS rules in a world
1413
When adding a lot of modules, every now and then they don't quite agree with each other on where things should live. A small amount of CSS can fix this, but manually patching CSS in the server or writing a local module is a pain. This module allows you to quickly and easily enter per-world CSS rules to make these tweaks instead.
1514

1615

17-
# Installation
16+
## Changelog
1817

19-
Using [FoundryGet](https://github.com/cswendrowski/foundryget)
18+
### v1.1.0
2019

21-
```
22-
foundryget install https://raw.githubusercontent.com/cswendrowski/FoundryVTT-Custom-CSS/master/module.json
23-
```
20+
Added the ability to organize Rules. This is *not* folder functionality!

custom-css.css

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.customCssSettings .fas {
2+
flex: 0;
3+
align-self: center;
4+
padding: 5px;
5+
}
6+
7+
.customCssSettings .fa-trash:hover {
8+
color: red;
9+
}
10+
11+
.customCssSettings h2 {
12+
padding-top: 20px;
13+
}
14+
15+
.customCssSettings h2:first-of-type {
16+
padding-top: 0;
17+
}
18+
19+
.rule {
20+
background-color: whitesmoke !important;
21+
}
22+
23+
/*
24+
.customCssSettings .base {
25+
background-color: #e6e6e6;
26+
}
27+
28+
.customCssSettings .folder {
29+
background-color: #cccccc;
30+
}
31+
32+
.customCssSettings .list-group-item {
33+
background-color: aliceblue;
34+
}
35+
36+
.customCssSettings .list-group {
37+
padding: .75rem 1.25rem;
38+
} */

custom-css.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ Hooks.once('ready', async function() {
2626

2727
for (var x = 1; x <= Settings.getMaxRules(); x++) {
2828
var rule = Settings.getRule(x);
29-
if (rule != "") {
30-
console.log("CustomCSS | Inserting rule " + rule);
29+
if (rule != "" && rule != "<DELETED>") {
30+
//console.log("CustomCSS | Inserting rule " + rule);
3131
sheet.insertRule(rule, sheet.cssRules.length);
3232
}
3333
}

module.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
"name": "custom-css",
33
"title": "Custom Css",
44
"description": "Add custom css to your world",
5-
"version": "1.0.0",
5+
"version": "1.1.0",
66
"minimumCoreVersion": "0.6.0",
77
"compatibleCoreVersion": "0.6.0",
88
"author": "Cody Swendrowski <cody@swendrowski.us>",
99
"esmodules": [
1010
"./custom-css.js"
1111
],
12+
"scripts": [
13+
"scripts/lib/Sortable.js"
14+
],
1215
"styles": [
1316
"./custom-css.css"
1417
],

0 commit comments

Comments
 (0)