Skip to content

Commit

Permalink
fix: keep hanging-punctuation visible for input and textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
naiyerasif committed Jun 7, 2024
1 parent e71382e commit 70fbbf6
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.github
banner.webp
banner.svg
CODE_OF_CONDUCT.md
11 changes: 9 additions & 2 deletions dist/preset.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Preset v4.0.0 | MIT License | https://github.com/Microflash/preset */
/*! Preset v4.0.1 | MIT License | https://github.com/Microflash/preset */
*, :before, :after {
box-sizing: border-box;
}
Expand All @@ -16,7 +16,6 @@
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
text-size-adjust: 100%;
hanging-punctuation: first last;
block-size: 100%;
}

Expand All @@ -31,6 +30,14 @@
}
}

:where(:not(:-webkit-any(input, textarea))) {
hanging-punctuation: first last;
}

:where(:not(:is(input, textarea))) {
hanging-punctuation: first last;
}

:where(body) {
tab-size: var(--preset-tab-size, 2);
min-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.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microflash/preset",
"version": "4.0.0",
"version": "4.0.1",
"description": "A modern CSS preset",
"keywords": [
"css",
Expand Down Expand Up @@ -29,7 +29,7 @@
"lightningcss-cli": "^1.25.1",
"sass": "^1.77.4"
},
"packageManager": "pnpm@9.1.4",
"packageManager": "pnpm@9.2.0",
"browserslist": [
"defaults"
]
Expand Down
7 changes: 5 additions & 2 deletions src/preset.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Preset v4.0.0 | MIT License | https://github.com/Microflash/preset */
/*! Preset v4.0.1 | MIT License | https://github.com/Microflash/preset */
*, ::before, ::after {
box-sizing: border-box;
}
Expand All @@ -15,7 +15,6 @@
:where(html) {
block-size: 100%;
text-size-adjust: 100%;
hanging-punctuation: first last;
}
@media (prefers-reduced-motion: no-preference), (update: fast) {
:where(html):focus-within {
Expand All @@ -29,6 +28,10 @@
scroll-padding-block-start: var(--preset-scroll-padding, 3rem);
}
}
:where(:not(input, textarea)) {
hanging-punctuation: first last;
}

:where(body) {
min-block-size: 100%;
tab-size: var(--preset-tab-size, 2);
Expand Down
10 changes: 7 additions & 3 deletions src/preset.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Preset v4.0.0 | MIT License | https://github.com/Microflash/preset */
/*! Preset v4.0.1 | 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,8 +25,6 @@
block-size: 100%;
// prevents adjustments of `font-size` after orientation changes
text-size-adjust: 100%;
// keeps hanging punctuations outside the line box (supported in Safari for now)
hanging-punctuation: first last;

// enables smooth scrolling when reduced-motion is unspecified
// opt-out the e-readers which may have low refresh rates using `update: fast`
Expand All @@ -46,6 +44,12 @@
}
}

// keeps hanging punctuation outside the line box (supported in Safari for now)
// except for `input` and `textarea` where they should be visible and inside the line box
:where(:not(input, textarea)) {
hanging-punctuation: first last;
}

:where(body) {
// allows percentage based `block-size` for the children of body
min-block-size: 100%;
Expand Down

0 comments on commit 70fbbf6

Please sign in to comment.