sc: move colours to base stylesheet
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 23 Apr 2018 15:53:49 +0000 (17:53 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 10 May 2018 14:49:06 +0000 (16:49 +0200)
Allow for different styles.

base.css
sc.css
sc.plp

index cd09f2dfeaa460d8204bf87b05867c9a05f73b40..557a21f8d5f62ad4b390e424033dbcb9bf3cea56 100644 (file)
--- a/base.css
+++ b/base.css
@@ -722,6 +722,69 @@ nav > .section {
        margin-top: 1em;
 }
 
+.units tbody tr:hover:not(.race) {
+       background: #EEE;
+}
+.unit-gas {
+       color: #040;
+}
+.unit-min, .unit-min a:not(:hover) {
+       color: #004;
+}
+.unit-supply {
+       color: #080;
+}
+.unit-o {color: #C08} /* organic */
+.unit-u {color: #44C} /* mechanic */
+.unit-p {color: #0A8} /* psionic */
+.unit-composed {
+       color: #C88;
+}
+.unit-air {
+       color: #08C;
+}
+.unit-x {color: #888}
+.unit-s {color: #890}
+.unit-m {color: #C70}
+.unit-l {color: #D22}
+.unit-h {color: #804}
+.magic-opt:before,
+.magic-opt:after {
+       color: #000;
+}
+.hurtrel, .units .hurtrel {
+       color: #778;
+}
+tbody .unit-shield {
+       color: #64A;
+}
+.unit-pdd {
+       color: #A8C;
+}
+.unit-splash {
+       color: #4A0;
+}
+.hurt-a {
+       color: #036;
+}
+.hurt-g {
+       color: #063;
+}
+.unit-massive {
+       color: #D88;
+}
+.unit-detect::before {
+       color: #0A8;
+}
+.unit-jump {
+       color: #8A4;
+}
+body .magic-perma {
+               text-decoration-color: #8C0;
+          -moz-text-decoration-color: #8C0;
+       -webkit-text-decoration-color: #8C0;
+}
+
 /* printing hints */
 
 @page {
diff --git a/sc.css b/sc.css
index 19b40b08312e3d77f381bad9236d29327c387e01..b60bd8dfb33b8af78f2b257bfab5f03cbe2b20f3 100644 (file)
--- a/sc.css
+++ b/sc.css
@@ -18,9 +18,6 @@ tr.alt td {
 .units tr th:first-child {
        padding-left: 0;
 }
-.units tbody tr:hover:not(.race) {
-       background: #EEE;
-}
 
 table h2 {
        padding: 1ex 0;
@@ -38,30 +35,9 @@ table h2 {
 .units td.unit + td.unit {
        padding-left: 0;
 }
-.unit-gas {
-       color: #040;
-}
-.unit-min, .unit-min a:not(:hover) {
-       color: #004;
-}
-.unit-supply {
-       color: #080;
-}
-.unit-o {color: #C08} /* organic */
-.unit-u {color: #44C} /* mechanic */
-.unit-p {color: #0A8} /* psionic */
 .unit-composed {
-       color: #C88;
        font-size: 70%;
 }
-.unit-air {
-       color: #08C;
-}
-.unit-x {color: #888}
-.unit-s {color: #890}
-.unit-m {color: #C70}
-.unit-l {color: #D22}
-.unit-h {color: #804}
 td .unit-jump,
 .hurt .unit-splash {
        position: absolute;
@@ -70,9 +46,6 @@ td .unit-massive {
        float: right;
        width: 0;
 }
-.hurtrel, .units .hurtrel {
-       color: #778;
-}
 td.hurtrel {
        padding-left: 1em;
 }
@@ -80,52 +53,27 @@ td.unit-shield,
 td.hurtrel {
        font-size: 70%;
 }
-tbody .unit-shield {
-       color: #64A;
-}
-.unit-pdd {
-       color: #A8C;
-}
-.unit-splash {
-       color: #4A0;
-}
-.hurt-a {
-       color: #036;
-}
-.hurt-g {
-       color: #063;
-}
-.unit-massive {
-       color: #D88;
-}
 .unit-detect::before {
        content: '!';
-       color: #0A8;
        font-size: 70%;
        vertical-align: super;
 }
 .unit-jump {
        margin-left: -.2em;
-       color: #8A4;
 }
 .unit-magic {
        padding-left: 0.5em;
 }
-.magic-opt::before {
-       color: #000;
+.magic-opt:before {
        content: '(';
        position: absolute;
        margin-left: -0.33em;
 }
-.magic-opt::after {
-       color: #000;
+.magic-opt:after {
        content: ')';
 }
 .magic-perma {
        text-decoration: underline;
-               text-decoration-color: #8C0;
-          -moz-text-decoration-color: #8C0;
-       -webkit-text-decoration-color: #8C0;
 }
 
 .units .val {
diff --git a/sc.plp b/sc.plp
index 6dfa65c3cb1ba57c05d712dacdbc14b19da11412..c929c9abfb1a4032d516a8167015799a9bd5787e 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -31,7 +31,7 @@ my $datafile = "sc-units-$Request.inc.pl";
 
 Html({
        title => "$scver{title} unit cheat sheet",
-       version => '1.1',
+       version => '1.2',
        description => [
                "Reference of $scver{game} unit properties,"
                . " comparing various statistics of all the units in $scver{name}"
@@ -46,7 +46,7 @@ Html({
                qw' starcraft2 lotv hots wol ',
        ],
        stylesheet => [qw'light'],
-       raw => '<link rel="stylesheet" type="text/css" media="all" href="/sc.css?1.1" title="light">',
+       raw => '<link rel="stylesheet" type="text/css" media="all" href="/sc.css?1.2">',
        data => [$datafile],
 });