Skip to content

Commit

Permalink
feat: improve selectors for svg and disabled elements
Browse files Browse the repository at this point in the history
  • Loading branch information
naiyerasif committed Jan 15, 2024
1 parent a4b15cd commit b0c9b88
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions dist/preset.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Preset v1.5.0 | MIT License | https://github.com/Microflash/preset */
/*! Preset v1.5.1 | 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 @@ -72,7 +72,7 @@
height: auto;
}

:where(svg:not([fill]), svg[fill=none]) {
:where(svg:not([fill][class]), svg[fill=none]:not([class])) {
stroke: currentColor;
stroke: var(--preset-stroke-color, currentColor);
stroke-linecap: round;
Expand Down Expand Up @@ -149,7 +149,7 @@
user-select: none;
}

:where(button, button[type], input[type=button], input[type=submit], input[type=reset])[disabled] {
:where(button, button[type], input[type=button], input[type=image], input[type=submit], input[type=reset])[disabled] {
cursor: not-allowed;
}

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": "1.5.0",
"version": "1.5.1",
"description": "A modern CSS preset",
"keywords": [
"css",
Expand Down
8 changes: 4 additions & 4 deletions src/preset.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Preset v1.5.0 | MIT License | https://github.com/Microflash/preset */
/*! Preset v1.5.1 | 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 @@ -79,15 +79,15 @@
}

// 1. Stop media from overflowing the container
// 2. Automatically adjust the `block-size` based on `inline-size`
// 2. Maintain aspect-ratio based on `block-size` / `inline-size`
:where(img, svg, video) {
max-inline-size: 100%; // 1
block-size: auto; // 2
}

// 1. Inherit `color` for stroke
// 2. Keep the strokes rounded for SVGs without fill
:where(svg:not([fill]), svg[fill="none"]) {
:where(svg:not([fill][class]), svg[fill="none"]:not([class])) {
stroke: var(--preset-stroke-color, currentColor); // 1
stroke-linecap: round; // 2
stroke-linejoin: round; // 2
Expand Down Expand Up @@ -168,7 +168,7 @@
}

// Add explicit cursor to indicate disabled elements
:where(button, button[type], input[type="button"], input[type="submit"], input[type="reset"])[disabled] {
:where(button, button[type], input[type="button"], input[type="image"], input[type="submit"], input[type="reset"])[disabled] {
cursor: not-allowed;
}

Expand Down

0 comments on commit b0c9b88

Please sign in to comment.