-
-
Notifications
You must be signed in to change notification settings - Fork 132
Conversation
Linking to #79 |
@@ -269,3 +275,89 @@ a > code { | |||
.media.v-center { | |||
align-items: center; | |||
} | |||
|
|||
// lightweight dark mode using some overrides | |||
@media (prefers-color-scheme: dark) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer a solution with css variables
@media (prefers-color-scheme: dark) {
:root {
--main-bg-color: dark;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is possible for the custom CSS like overriding body background. To override the third-party CSS (eg. Bulma panel and card) you'll still have to overwrite the imported rules afaik. Bulma supports customization but only at compile time with SASS variables afaik.
Is that what you're aiming for here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree but did you try this
// create css variables
$black_value: hsl(0, 0%, 4%) !default;
// assign css property to bulma variables
$black: var(--color-black);
// Framework code will work with css property notation
div {
background-color: #{$black};
}
// Framework code end
// Create css variables
:root {
--color-black: #{$black_value};
}
produces
div {
background-color: var(--color-black);
}
:root {
--color-black: #0a0a0a;
}
this should work as long as no other transform functions are applied on $black
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@anthonyringoet could you rebase it and land this? Also we might want a switch for light/dark theme in the future |
e2edd46
to
1d26894
Compare
@zekth rebased the changes from upstream, feel free to check again |
@StarpTech can you recheck it? |
@StarpTech @zekth No need to waste your time rechecking it. FYI, only had time to rebase and check these incoming changes. Did not have the time to add the requested changes. |
Closing for https://github.com/fastify/website-next |
Added a lightweight dark mode. Can certainly be improved, only used some CSS overrides.
Checklist
npm run test
andnpm run benchmark