Skip to content

Commit

Permalink
feat: linear timing function for outline-offset
Browse files Browse the repository at this point in the history
  • Loading branch information
naiyerasif committed Feb 25, 2024
1 parent fc637d7 commit 3c79540
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
10 changes: 9 additions & 1 deletion dist/preset.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Preset v3.0.0 | MIT License | https://github.com/Microflash/preset */
/*! Preset v3.1.0 | MIT License | https://github.com/Microflash/preset */
* {
line-height: calc(0.3rem + 2ex + 0.3rem);
line-height: var(--preset-line-height, calc(0.3rem + 2ex + 0.3rem));
Expand Down Expand Up @@ -168,6 +168,14 @@
transition-duration: 0.25s;
}
}
@supports (transition-timing-function: linear(0, 1)) {
:where(.focus-visible).js-focus-visible, .js-focus-visible :where(.focus-visible) {
transition-timing-function: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);
}
:where(:focus-visible) {
transition-timing-function: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);
}
}
@media (prefers-reduced-motion: no-preference) {
.js-has-pseudo :where([csstools-has-1m-2w-2p-37-14-1m-38-2p-36-2v-2t-38-15]) {
scroll-behavior: smooth;
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.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microflash/preset",
"version": "3.0.0",
"version": "3.1.0",
"description": "A modern CSS preset",
"keywords": [
"css",
Expand Down
8 changes: 7 additions & 1 deletion src/preset.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Preset v3.0.0 | MIT License | https://github.com/Microflash/preset */
/*! Preset v3.1.0 | MIT License | https://github.com/Microflash/preset */

// 1. Set `line-height` based on x-height of the font and `font-size` to automatically adjust for all `font-size` values
// 2. Prevent text overflow for inline elements
Expand Down Expand Up @@ -187,6 +187,12 @@
}
}

@supports (transition-timing-function: linear(0, 1)) {
:where(:focus-visible) {
transition-timing-function: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);
}
}

// Enable smooth-scrolling for nested scrollable elements
@media (prefers-reduced-motion: no-preference) {
:where(:has(:target)) {
Expand Down

0 comments on commit 3c79540

Please sign in to comment.