Changeset 387:023783060913 for themes/ductile/_public.php
- Timestamp:
- 06/18/11 14:24:58 (14 years ago)
- Branch:
- themes
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
themes/ductile/_public.php
r378 r387 44 44 45 45 # Main font 46 $ main_font_selectors = 'body, #supranav li a span, #comments.me, a.comment-number';47 if (isset($s['body_font'])) self::prop($css,$ main_font_selectors,'font-family',self::fontDef($s['body_font']));46 $selectors = 'body, #supranav li a span, #comments.me, a.comment-number'; 47 if (isset($s['body_font'])) self::prop($css,$selectors,'font-family',self::fontDef($s['body_font'])); 48 48 49 49 # Secondary font 50 $ alternate_font_selectors = '#blogdesc, #supranav, #content-info, #subcategories, #comments-feed, #sidebar h2, #sidebar h3, #footer p';51 if (isset($s['alternate_font'])) self::prop($css,$ alternate_font_selectors,'font-family',self::fontDef($s['alternate_font']));50 $selectors = '#blogdesc, #supranav, #content-info, #subcategories, #comments-feed, #sidebar h2, #sidebar h3, #footer p'; 51 if (isset($s['alternate_font'])) self::prop($css,$selectors,'font-family',self::fontDef($s['alternate_font'])); 52 52 53 53 # Inside posts links font weight 54 $ links = '.post-excerpt a, .post-content a';55 if (isset($s[' body_link_w'])) self::prop($css,$links,'font-weight',($s['body_link_w'] ? 'bold' : 'normal'));54 $selectors = '.post-excerpt a, .post-content a'; 55 if (isset($s['post_link_w'])) self::prop($css,$selectors,'font-weight',($s['post_link_w'] ? 'bold' : 'normal')); 56 56 57 57 # Inside posts links colors (normal, visited) 58 $ links_selectors = '.post-excerpt a:link, .post-excerpt a:visited, .post-content a:link, .post-content a:visited';59 if (isset($s[' body_link_v_c'])) self::prop($css,$links_selectors,'color',$s['body_link_v_c']);58 $selectors = '.post-excerpt a:link, .post-excerpt a:visited, .post-content a:link, .post-content a:visited'; 59 if (isset($s['post_link_v_c'])) self::prop($css,$selectors,'color',$s['post_link_v_c']); 60 60 61 61 # Inside posts links colors (hover, active, focus) 62 $ links_alternate_selectors = '.post-excerpt a:hover, .post-excerpt a:active, .post-excerpt a:focus, .post-content a:hover, .post-content a:active, .post-content a:focus';63 if (isset($s[' body_link_f_c'])) self::prop($css,$links_alternate_selectors,'color',$s['body_link_f_c']);62 $selectors = '.post-excerpt a:hover, .post-excerpt a:active, .post-excerpt a:focus, .post-content a:hover, .post-content a:active, .post-content a:focus'; 63 if (isset($s['post_link_f_c'])) self::prop($css,$selectors,'color',$s['post_link_f_c']); 64 64 65 65 # Style directives … … 73 73 } 74 74 75 # Large screens 76 $css_large = array(); 77 78 # Blog title font weight 79 $selectors = 'h1, h1 a:link, h1 a:visited, h1 a:hover, h1 a:visited, h1 a:focus'; 80 if (isset($s['blog_title_w'])) self::prop($css_large,$selectors,'font-weight',($s['blog_title_w'] ? 'bold' : 'normal')); 81 82 # Blog title font size 83 $selectors = 'h1'; 84 if (isset($s['blog_title_s'])) self::prop($css_large,$selectors,'font-size',$s['blog_title_s']); 85 86 # Blog title color 87 $selectors = 'h1 a:link, h1 a:visited, h1 a:hover, h1 a:visited, h1 a:focus'; 88 if (isset($s['blog_title_c'])) self::prop($css_large,$selectors,'color',$s['blog_title_c']); 89 90 # Post title font weight 91 $selectors = 'h2.post-title, h2.post-title a:link, h2.post-title a:visited, h2.post-title a:hover, h2.post-title a:visited, h2.post-title a:focus'; 92 if (isset($s['post_title_w'])) self::prop($css_large,$selectors,'font-weight',($s['post_title_w'] ? 'bold' : 'normal')); 93 94 # Post title font size 95 $selectors = 'h2.post-title'; 96 if (isset($s['post_title_s'])) self::prop($css_large,$selectors,'font-size',$s['post_title_s']); 97 98 # Post title color 99 $selectors = 'h2.post-title a:link, h2.post-title a:visited, h2.post-title a:hover, h2.post-title a:visited, h2.post-title a:focus'; 100 if (isset($s['post_title_c'])) self::prop($css_large,$selectors,'color',$s['post_title_c']); 101 102 # Style directives for large screens 103 if (count($css_large)) { 104 $res .= '@media only screen and (min-width: 481px) {'."\n"; 105 foreach ($css_large as $selector => $values) { 106 $res .= $selector." {\n"; 107 foreach ($values as $k => $v) { 108 $res .= $k.':'.$v.";\n"; 109 } 110 $res .= "}\n"; 111 } 112 $res .= "}\n"; 113 } 114 115 # Small screens 116 $css_small = array(); 117 118 # Blog title font weight 119 $selectors = 'h1, h1 a:link, h1 a:visited, h1 a:hover, h1 a:visited, h1 a:focus'; 120 if (isset($s['blog_title_w_m'])) self::prop($css_small,$selectors,'font-weight',($s['blog_title_w_m'] ? 'bold' : 'normal')); 121 122 # Blog title font size 123 $selectors = 'h1'; 124 if (isset($s['blog_title_s_m'])) self::prop($css_small,$selectors,'font-size',$s['blog_title_s_m']); 125 126 # Blog title color 127 $selectors = 'h1 a:link, h1 a:visited, h1 a:hover, h1 a:visited, h1 a:focus'; 128 if (isset($s['blog_title_c_m'])) self::prop($css_small,$selectors,'color',$s['blog_title_c_m']); 129 130 # Post title font weight 131 $selectors = 'h2.post-title, h2.post-title a:link, h2.post-title a:visited, h2.post-title a:hover, h2.post-title a:visited, h2.post-title a:focus'; 132 if (isset($s['post_title_w_m'])) self::prop($css_small,$selectors,'font-weight',($s['post_title_w_m'] ? 'bold' : 'normal')); 133 134 # Post title font size 135 $selectors = 'h2.post-title'; 136 if (isset($s['post_title_s_m'])) self::prop($css_small,$selectors,'font-size',$s['post_title_s_m']); 137 138 # Post title color 139 $selectors = 'h2.post-title a:link, h2.post-title a:visited, h2.post-title a:hover, h2.post-title a:visited, h2.post-title a:focus'; 140 if (isset($s['post_title_c_m'])) self::prop($css_small,$selectors,'color',$s['post_title_c_m']); 141 142 # Style directives for small screens 143 if (count($css_small)) { 144 $res .= '@media only screen and (max-width: 480px) {'."\n"; 145 foreach ($css_small as $selector => $values) { 146 $res .= $selector." {\n"; 147 foreach ($values as $k => $v) { 148 $res .= $k.':'.$v.";\n"; 149 } 150 $res .= "}\n"; 151 } 152 $res .= "}\n"; 153 } 154 75 155 return $res; 76 156 }
Note: See TracChangeset
for help on using the changeset viewer.