From d8b1b3fbfe83861af3bd00dc3407d509d5f5a8af Mon Sep 17 00:00:00 2001
From: Arkerthan <arkerthan@gmail.com>
Date: Sun, 27 Dec 2020 18:53:52 +0100
Subject: [PATCH] create css style module and move <<checkvar>> macro styles
 there

---
 Makefile                       | 6 +++++-
 build.config.json              | 3 ++-
 compile.bat                    | 6 ++++--
 compile.sh                     | 4 +++-
 css/001-lib/macros.css         | 2 ++
 src/gui/css/mainStyleSheet.css | 3 ---
 6 files changed, 16 insertions(+), 8 deletions(-)
 create mode 100644 css/001-lib/macros.css

diff --git a/Makefile b/Makefile
index e5eae25cd35..16ad64e8af9 100644
--- a/Makefile
+++ b/Makefile
@@ -36,9 +36,13 @@ bin/%.html: bin/tmp
 bin/fc.js: bin/
 	devTools/concatFiles.sh js/ '*.js' $@
 
+bin/fc.css: bin/
+	devTools/concatFiles.sh css/ '*.css' $@
+
 bin/tmp: bin/fc.js injectGitCommitHash
-	$(TWEEGO) --module=bin/fc.js --head resources/raster/favicon/arcologyVector.html src/ > $@
+	$(TWEEGO) --module=bin/fc.js --module=bin/fc.css --head resources/raster/favicon/arcologyVector.html src/ > $@
 	rm -f bin/fc.js
+	rm -f bin/fc.css
 
 injectGitCommitHash:
 	printf "App.Version.commitHash = '%s';\n" $(COMMIT) > src/002-config/fc-version.js.commitHash.js
diff --git a/build.config.json b/build.config.json
index 3ca42b2f73c..29c31825181 100644
--- a/build.config.json
+++ b/build.config.json
@@ -8,7 +8,8 @@
 	"gitVersionFile": "src/002-config/fc-version.js.commitHash.js",
 	"sources": {
 		"module": {
-			"js": ["js/**/*.js"]
+			"js": ["js/**/*.js"],
+			"css": ["css/**/*.css"]
 		},
 		"story": {
 			"css": ["src/**/*.css"],
diff --git a/compile.bat b/compile.bat
index 4e025315bef..ec8bda25248 100644
--- a/compile.bat
+++ b/compile.bat
@@ -28,13 +28,15 @@ if %GITFOUND% == yes (
 
 if not exist "bin\resources" mkdir bin\resources
 CALL devTools/concatFiles.bat js\ "*.js" bin\fc.js
+CALL devTools/concatFiles.bat css\ "*.css" bin\fc.css
 :: Run the appropriate compiler for the user's CPU architecture.
 if %PROCESSOR_ARCHITECTURE% == AMD64 (
-	CALL "%~dp0devTools\tweeGo\tweego_win64.exe" -o "%~dp0bin/FC_pregmod.html" --module=bin/fc.js --head resources/raster/favicon/arcologyVector.html "%~dp0src"
+	CALL "%~dp0devTools\tweeGo\tweego_win64.exe" -o "%~dp0bin/FC_pregmod.html" --module=bin/fc.js --module=bin/fc.css --head resources/raster/favicon/arcologyVector.html "%~dp0src"
 ) else (
-	CALL "%~dp0devTools\tweeGo\tweego_win86.exe" -o "%~dp0bin/FC_pregmod.html" --module=bin/fc.js --head resources/raster/favicon/arcologyVector.html "%~dp0src"
+	CALL "%~dp0devTools\tweeGo\tweego_win86.exe" -o "%~dp0bin/FC_pregmod.html" --module=bin/fc.js --module=bin/fc.css --head resources/raster/favicon/arcologyVector.html "%~dp0src"
 )
 DEL bin\fc.js
+DEL bin\fc.css
 IF EXIST "%~dp0src\002-config\fc-version.js.commitHash.js" DEL "%~dp0src\002-config\fc-version.js.commitHash.js"
 
 popd
diff --git a/compile.sh b/compile.sh
index 26645eb66ad..3f48f29bb31 100755
--- a/compile.sh
+++ b/compile.sh
@@ -75,8 +75,10 @@ function compile() {
 	fi
 
 	devTools/concatFiles.sh js/ '*.js' bin/fc.js
-	$TWEEGO_EXE -o $file --module=bin/fc.js --head resources/raster/favicon/arcologyVector.html src/ || build_failed="true"
+	devTools/concatFiles.sh css/ '*.css' bin/css.js
+	$TWEEGO_EXE -o $file --module=bin/fc.js --module=bin/fc.css --head resources/raster/favicon/arcologyVector.html src/ || build_failed="true"
 	rm -f bin/fc.js
+	rm -f bin/fc.css
 	if [ "$build_failed" = "true" ]; then
 		echoError "Build failed."
 		exit 1
diff --git a/css/001-lib/macros.css b/css/001-lib/macros.css
new file mode 100644
index 00000000000..39a2dd5778e
--- /dev/null
+++ b/css/001-lib/macros.css
@@ -0,0 +1,2 @@
+/*! <<checkvars>> macro for SugarCube 2.x */
+#ui-dialog-body.checkvars{padding:1em}#ui-dialog-body.checkvars h1{font-size:1em;margin-top:0}#ui-dialog-body.checkvars table{border-collapse:collapse;border-spacing:0}#ui-dialog-body.checkvars thead tr{border-bottom:2px solid #444}#ui-dialog-body.checkvars tr:not(:first-child){border-top:1px solid #444}#ui-dialog-body.checkvars td,#ui-dialog-body.checkvars th{padding:.25em 1em}#ui-dialog-body.checkvars td:first-child,#ui-dialog-body.checkvars th:first-child{padding-left:.5em;border-right:1px solid #444}#ui-dialog-body.checkvars td:last-child,#ui-dialog-body.checkvars th:last-child{padding-right:.5em}#ui-dialog-body.checkvars th:first-child{text-align:center}#ui-dialog-body.checkvars td:first-child{font-weight:700;text-align:right}#ui-dialog-body.checkvars td{font-family:monospace,monospace;vertical-align:top;white-space:pre-wrap}#ui-dialog-body.checkvars .scroll-pad{margin:0;padding:0}
diff --git a/src/gui/css/mainStyleSheet.css b/src/gui/css/mainStyleSheet.css
index 7c5b01938e6..290a25457cb 100644
--- a/src/gui/css/mainStyleSheet.css
+++ b/src/gui/css/mainStyleSheet.css
@@ -185,9 +185,6 @@ img.paperdoll {
 .violet, .libido.inc { color: violet }
 .khaki, .libido.dec { color: khaki }
 
-/*! <<checkvars>> macro for SugarCube 2.x */
-#ui-dialog-body.checkvars{padding:1em}#ui-dialog-body.checkvars h1{font-size:1em;margin-top:0}#ui-dialog-body.checkvars table{border-collapse:collapse;border-spacing:0}#ui-dialog-body.checkvars thead tr{border-bottom:2px solid #444}#ui-dialog-body.checkvars tr:not(:first-child){border-top:1px solid #444}#ui-dialog-body.checkvars td,#ui-dialog-body.checkvars th{padding:.25em 1em}#ui-dialog-body.checkvars td:first-child,#ui-dialog-body.checkvars th:first-child{padding-left:.5em;border-right:1px solid #444}#ui-dialog-body.checkvars td:last-child,#ui-dialog-body.checkvars th:last-child{padding-right:.5em}#ui-dialog-body.checkvars th:first-child{text-align:center}#ui-dialog-body.checkvars td:first-child{font-weight:700;text-align:right}#ui-dialog-body.checkvars td{font-family:monospace,monospace;vertical-align:top;white-space:pre-wrap}#ui-dialog-body.checkvars .scroll-pad{margin:0;padding:0}
-
 div.output{
 width: 100%;
 width: 100vw;
-- 
GitLab