Skip to content

Commit

Permalink
feat: support user color scheme preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
naiyerasif committed Jul 23, 2024
1 parent 7a6da61 commit 38e9308
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
Binary file modified banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion dist/preset.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Preset v4.0.3 | MIT License | https://github.com/Microflash/preset */
/*! Preset v4.1.0 | MIT License | https://github.com/Microflash/preset */
*, :before, :after {
box-sizing: border-box;
}
Expand All @@ -16,6 +16,7 @@
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
text-size-adjust: 100%;
color-scheme: light dark;
hanging-punctuation: first last;
block-size: 100%;
}
Expand Down
4 changes: 2 additions & 2 deletions dist/preset.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microflash/preset",
"version": "4.0.3",
"version": "4.1.0",
"description": "A modern CSS preset",
"keywords": [
"css",
Expand All @@ -27,9 +27,9 @@
},
"devDependencies": {
"lightningcss-cli": "^1.25.1",
"sass": "^1.77.6"
"sass": "^1.77.8"
},
"packageManager": "pnpm@9.5.0",
"packageManager": "pnpm@9.6.0",
"browserslist": [
"defaults"
]
Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/preset.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Preset v4.0.3 | MIT License | https://github.com/Microflash/preset */
/*! Preset v4.1.0 | MIT License | https://github.com/Microflash/preset */
*, ::before, ::after {
box-sizing: border-box;
}
Expand All @@ -15,6 +15,7 @@
:where(html) {
block-size: 100%;
text-size-adjust: 100%;
color-scheme: light dark;
hanging-punctuation: first last;
}
@media (prefers-reduced-motion: no-preference), (update: fast) {
Expand Down
4 changes: 3 additions & 1 deletion src/preset.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Preset v4.0.3 | MIT License | https://github.com/Microflash/preset */
/*! Preset v4.1.0 | MIT License | https://github.com/Microflash/preset */

// sets the default value of `box-sizing` from `content-box` to `border-box`
// so that `inline-size` is not affected by `padding` or `border`
Expand All @@ -25,6 +25,8 @@
block-size: 100%;
// prevents adjustments of `font-size` after orientation changes
text-size-adjust: 100%;
// opt into user's color scheme preferences
color-scheme: light dark;
// keeps hanging punctuation outside the line box (supported in Safari for now)
hanging-punctuation: first last;

Expand Down

0 comments on commit 38e9308

Please sign in to comment.