fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-12-28 09:22 am

[dw-free] Practicality: custom colors not working

[commit: http://hg.dwscoalition.org/dw-free/rev/718436dc0a30]

http://bugs.dwscoalition.org/show_bug.cgi?id=4142

Make custom colors CSS in Core 2 more specific; make certain CSS in
Practicality less specific.

Patch by [personal profile] ninetydegrees.

Files modified:
  • bin/upgrading/s2layers/core2.s2
  • bin/upgrading/s2layers/practicality/layout.s2
--------------------------------------------------------------------------------
diff -r ff2375f5dfd3 -r 718436dc0a30 bin/upgrading/s2layers/core2.s2
--- a/bin/upgrading/s2layers/core2.s2	Wed Dec 28 17:18:13 2011 +0800
+++ b/bin/upgrading/s2layers/core2.s2	Wed Dec 28 17:22:24 2011 +0800
@@ -3484,26 +3484,26 @@
             var string{} custom_background_location;
 
             $custom_foreground_location = {
-                "subject" => "h3.entry-title a {color:",
-                "userpic_border" => "div.userpic a img {border: solid; border-color:",
-                "postername" => "span.entry-poster a {color:",
-                "entry" => "div.entry-content {color:",
-                "metadata" => ".metadata {color:",
-                "bottom_links" => ".footer a {color:"
+                "subject" => ".entry h3.entry-title a {color:",
+                "userpic_border" => ".entry .userpic a img {border: solid !important; border-color:",
+                "postername" => ".entry .entry-poster a {color:",
+                "entry" => ".entry .entry-content {color:",
+                "metadata" => ".entry .metadata {color:",
+                "bottom_links" => ".entry .footer a {color:"
                 };
 
             $custom_background_location = {
-                "subject" => "h3.entry-title {background-color:",
-                "userpic_background" => "div.userpic a img {padding: 2px; background-color:",
-                "entry_border" => "div.entry-content {border: solid; border-color:",
-                "metadata_background" => ".metadata {background-color:",
-                "footer_border" => "div.footer {border: solid; border-color:"
+                "subject" => ".entry h3.entry-title {background-color:",
+                "userpic_background" => ".entry .userpic a img {padding: 2px !important; background-color:",
+                "entry_border" => ".entry .entry-content {border: solid !important; border-color:",
+                "metadata_background" => ".entry .metadata {background-color:",
+                "footer_border" => ".entry .footer {border: solid !important; border-color:"
                 };
 
             var string custom_foreground_css = "";
             var string custom_background_css = "";
-            $custom_foreground_css = """.journal-$e.journal.username $custom_foreground_location{$*custom_foreground_element} $fg; } \n""";
-            $custom_background_css = """.journal-$e.journal.username $custom_background_location{$*custom_background_element} $bg; } \n\n""";
+            $custom_foreground_css = """.journal-$e.journal.username $custom_foreground_location{$*custom_foreground_element} $fg !important; } \n""";
+            $custom_background_css = """.journal-$e.journal.username $custom_background_location{$*custom_background_element} $bg !important; } \n\n""";
 
             var string custom_colors_css;
             if ($*custom_colors_template != ""){
diff -r ff2375f5dfd3 -r 718436dc0a30 bin/upgrading/s2layers/practicality/layout.s2
--- a/bin/upgrading/s2layers/practicality/layout.s2	Wed Dec 28 17:18:13 2011 +0800
+++ b/bin/upgrading/s2layers/practicality/layout.s2	Wed Dec 28 17:22:24 2011 +0800
@@ -156,32 +156,32 @@
     var string userpic_css = "";
         if ($*userpics_position == "left") {
             $userpic_css = """
-            .has-userpic div.entry div.userpic,
-            .has-userpic div.comment div.userpic {
+            .has-userpic .entry .userpic,
+            .has-userpic .comment .userpic {
                 float: left;
                 }
-            .has-userpic div.entry .header,
-            .has-userpic div.comment .header {
+            .has-userpic .entry .header,
+            .has-userpic .comment .header {
                 text-align: right;
                 }
-            .has-userpic div.entry .header {
+            .has-userpic .entry .header {
                 margin-left: $entry_header_margin;
                 }
-            .has-userpic div.comment .header {
+            .has-userpic .comment .header {
                 margin-left: $comment_header_margin;
                 }
             """;
         }
         elseif ($*userpics_position == "right") {
             $userpic_css = """
-            .has-userpic div.entry div.userpic,
-            .has-userpic div.comment div.userpic {
+            .has-userpic .entry .userpic,
+            .has-userpic .comment .userpic {
                 float: right;
                 }
-            .has-userpic div.entry .header {
+            .has-userpic .entry .header {
                 margin-right: $entry_header_margin;
                 }
-            .has-userpic div.comment .header {
+            .has-userpic .comment .header {
                 margin-right: $comment_header_margin;
                 }
             """;
@@ -391,23 +391,23 @@
     list-style: none;
     }
 
-div.module-content div.userpic {
+.module-content .userpic {
     text-align: center;
     }
 
-div.module-content div.userpic img {
+.module-content .userpic img {
     background: $*color_header_background;
     border: none;
     padding: 10px;
     }
 
-div.journal-name {
+.journal-name {
     font-variant: small-caps;
     margin-top: 5px;
     text-align: center;
     }
 
-div.journal-website-name {
+.journal-website-name {
     font-variant: small-caps;
     text-align: center;
     }
@@ -426,7 +426,7 @@
     list-style: none;;
     }
 
-div.module-navlinks {
+.module-navlinks {
     color: $*color_module_title;
     font-variant: small-caps;
     font-size: 1.45em;
@@ -435,55 +435,55 @@
     text-align: right;
     }
 
-div.module-navlinks a {
+.module-navlinks a {
     color: $*color_module_title;
     }
 
-div.manage-link {
+.manage-link {
     margin: 10px 0 0;
     text-align: right;
     }
 
-div.module-calendar table {
+.module-calendar table {
     text-align: center;
     }
 
-div.module-calendar th {
+.module-calendar th {
     background: $*color_page_background;
     color: $*color_page_text;
     border: 1px solid $*color_entry_border;
     padding: 0;
     }
 
-div.module-calendar td.empty-day {
+.module-calendar td.empty-day {
     border: 1px solid $*color_entry_border;
     }
 
-div.module-calendar td.entry-day {
+.module-calendar td.entry-day {
     background: $*color_page_background;
     border: 1px solid $*color_entry_border;
     }
 
-div.module-calendar td.entry-day a { color: $*color_page_link; }
-div.module-calendar td.entry-day a:visited { color: $*color_page_link_visited; }
-div.module-calendar td.entry-day a:hover { color: $*color_page_link_hover; }
-div.module-calendar td.entry-day a:active { color: $*color_page_link_active; }
+.module-calendar td.entry-day a { color: $*color_page_link; }
+.module-calendar td.entry-day a:visited { color: $*color_page_link_visited; }
+.module-calendar td.entry-day a:hover { color: $*color_page_link_hover; }
+.module-calendar td.entry-day a:active { color: $*color_page_link_active; }
 
 /*--- Entries ---*/
 
-div.entry {
+.entry {
     border: none;
     border-bottom: 5px solid $*color_entry_border;
     padding: 10px;
     margin: 0 0 15px 0;
     }
 
-div.entry-content {
+.entry-content {
     margin: 10px 0 0;
     min-height: 100px;
     }
 
-div.entry div.header {
+.entry .header {
     $entry_title_font
     font-size: 1em;
     padding: 0;
@@ -511,12 +511,12 @@
     color: $*color_entry_text;
     }
 
-.has-userpic div.entry div.userpic {
+.has-userpic .entry .userpic {
     border: none;
     margin: -20px 10px 10px 10px;
     }
 
-.has-userpic div.entry div.userpic img {
+.entry .userpic img {
     background: $*color_header_background;
     border: none;
     padding: 10px;
@@ -545,17 +545,17 @@
     text-align: right;
     }
 
-div.metadata ul {
+.metadata ul {
     padding: 0;
     margin: 0;
     }
 
-div.metadata ul li {
+.metadata ul li {
     padding: 0;
     margin: 0;
     }
 
-span.metadata-item-location, span.metadata-item-music, span.metadata-item-mood, div.tag ul {
+.metadata-item-location, .metadata-item-music, .metadata-item-mood, .tag ul {
     color: $*color_entry_link;
     text-align: right;
     }
@@ -564,13 +564,13 @@
     clear: both;
     }
 
-div.tag {
+.tag {
     margin: 1em 0 .5em 0;
     font-size: 0.85em;
     font-variant: small-caps;
     }
 
-div.tag ul li {
+.tag ul li {
     margin: .5em 0 0;
     text-align: right;
     }
@@ -771,13 +771,13 @@
     width: 80% !important;
     }
 
-.has-userpic div.comment div.userpic {
+.has-userpic .comment .userpic {
     border: none;
     display: block;
     margin: -1em .5em .5em .5em;
     }
 
-.has-userpic div.comment div.userpic img {
+.comment .userpic img {
     background: $*color_header_background;
     border: none;
     padding: 10px;
--------------------------------------------------------------------------------