Skip to content

Commit 01bc318

Browse files
committed
Fix up switch to CSS variables
1 parent a30fcf9 commit 01bc318

6 files changed

Lines changed: 17 additions & 18 deletions

File tree

assets/stylesheets/components/_prism.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ html {
66
--prismFunction: #dd4a68;
77
--prismVariable: #e90;
88
}
9-
html.dark {
9+
html._theme-dark {
1010
--prismValue: #eb8160;
1111
--prismText: #ddcf88;
1212
--prismOperator: #b1c676;

assets/stylesheets/global/_classes.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzMzNzdjMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+);
153153
}
154154
}
155-
html.dark %external-link {
155+
html._theme-dark %external-link {
156156
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2NiZDBkMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+);
157157
}
158158

assets/stylesheets/pages/_bash.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}
66

77
th[align=left] {
8-
border-left: 1px solid $boxBorder;
8+
border-left: 1px solid var(--boxBorder);
99
}
1010

1111
code { @extend %label; }

assets/stylesheets/pages/_dart.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
.features {
88
float: right;
9-
color: $textColorLight;
9+
color: var(--textColorLight);
1010
}
1111
}
1212
}

assets/stylesheets/pages/_qt.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
// Function headers
55
h3.fn > code {
66
float: right;
7-
color: $textColorLight;
7+
color: var(--textColorLight);
88
}
99
}

test/app_test.rb

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ def app
5555
get '/'
5656
assert_includes last_response.body, '<body class="foo">'
5757
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
5870
end
5971

6072
describe "/[static-page]" do
@@ -110,19 +122,6 @@ def app
110122
refute_includes last_response.body, 'foo'
111123
end
112124

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-
126125
it "sets default size" do
127126
get '/manifest.appcache'
128127
assert_includes last_response.body, '20rem'

0 commit comments

Comments
 (0)