Unified · Split
| @@ -6,7 +6,7 @@ html { · 5 unmodified lines | ||
| 6 | 6 | --prismFunction: #dd4a68; |
| 7 | 7 | --prismVariable: #e90; |
| 8 | 8 | } |
| 9 | −html.dark { | |
| 9 | +html._theme-dark { | |
| 10 | 10 | --prismValue: #eb8160; |
| 11 | 11 | --prismText: #ddcf88; |
| 12 | 12 | --prismOperator: #b1c676; |
| @@ -152,7 +152,7 @@ · 151 unmodified lines | ||
| 152 | 152 | background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzMzNzdjMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+); |
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | −html.dark %external-link { | |
| 155 | +html._theme-dark %external-link { | |
| 156 | 156 | background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2NiZDBkMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+); |
| 157 | 157 | } |
| 158 | 158 | |
| @@ -5,7 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | th[align=left] { |
| 8 | − border-left: 1px solid $boxBorder; | |
| 8 | + border-left: 1px solid var(--boxBorder); | |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | code { @extend %label; } |
| @@ -6,7 +6,7 @@ · 5 unmodified lines | ||
| 6 | 6 | |
| 7 | 7 | .features { |
| 8 | 8 | float: right; |
| 9 | − color: $textColorLight; | |
| 9 | + color: var(--textColorLight); | |
| 10 | 10 | } |
| 11 | 11 | } |
| 12 | 12 | } |
| @@ -4,6 +4,6 @@ · 3 unmodified lines | ||
| 4 | 4 | // Function headers |
| 5 | 5 | h3.fn > code { |
| 6 | 6 | float: right; |
| 7 | − color: $textColorLight; | |
| 7 | + color: var(--textColorLight); | |
| 8 | 8 | } |
| 9 | 9 | } |
| @@ -55,6 +55,18 @@ class AppTest < MiniTest::Spec · 54 unmodified lines | ||
| 55 | 55 | get '/' |
| 56 | 56 | assert_includes last_response.body, '<body class="foo">' |
| 57 | 57 | end |
| 58 | + | |
| 59 | + it "sets the <html> theme from cookie" do | |
| 60 | + get '/' | |
| 61 | + assert_match %r{<html [^>]*class="[^\"]*_theme-default}, last_response.body | |
| 62 | + refute_includes last_response.body, '_theme-dark' | |
| 63 | + | |
| 64 | + set_cookie('dark=1') | |
| 65 | + | |
| 66 | + get '/' | |
| 67 | + assert_match %r{<html [^>]*class="[^\"]*_theme-dark}, last_response.body | |
| 68 | + refute_includes last_response.body, '_theme-default' | |
| 69 | + end | |
| 58 | 70 | end |
| 59 | 71 | |
| 60 | 72 | describe "/[static-page]" do |
| @@ -110,19 +122,6 @@ class AppTest < MiniTest::Spec · 49 unmodified lines | ||
| 110 | 122 | refute_includes last_response.body, 'foo' |
| 111 | 123 | end |
| 112 | 124 | |
| 113 | − it "has the word 'default' when no 'dark' cookie is set" do | |
| 114 | − get '/manifest.appcache' | |
| 115 | − assert_includes last_response.body, '# default' | |
| 116 | − refute_includes last_response.body, '# dark' | |
| 117 | − end | |
| 118 | − | |
| 119 | − it "has the word 'dark' when the cookie is set" do | |
| 120 | − set_cookie('dark=1') | |
| 121 | − get '/manifest.appcache' | |
| 122 | − assert_includes last_response.body, '# dark' | |
| 123 | − refute_includes last_response.body, '# default' | |
| 124 | − end | |
| 125 | − | |
| 126 | 125 | it "sets default size" do |
| 127 | 126 | get '/manifest.appcache' |
| 128 | 127 | assert_includes last_response.body, '20rem' |