Skip to content

Commit

Permalink
feat: textareas with min-height when rows are not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
naiyerasif committed Oct 22, 2023
1 parent da1e7e4 commit c410da6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
6 changes: 5 additions & 1 deletion dist/preset.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Preset v1.0.2 | MIT License | https://github.com/Microflash/preset */
/*! Preset v1.0.3 | MIT License | https://github.com/Microflash/preset */
* {
margin: 0;
line-height: calc(0.3rem + 2ex + 0.3rem);
Expand Down Expand Up @@ -123,6 +123,10 @@
}
}

:where(textarea:not([rows])) {
min-height: 10em;
}

:where(a[href], area, button, input:not([type=text]):not([type=email]):not([type=file]):not([type=number]):not([type=password]):not([type=""]):not([type=tel]):not([type=url]), label[for], select, summary, [role=button], [onclick], [tabindex]:not([tabindex*="-"])),
:where(input[type=file])::file-selector-button {
cursor: pointer;
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.0.2",
"version": "1.0.3",
"description": "A modern CSS preset",
"keywords": [
"css",
Expand Down
7 changes: 6 additions & 1 deletion src/preset.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Preset v1.0.2 | MIT License | https://github.com/Microflash/preset */
/*! Preset v1.0.3 | MIT License | https://github.com/Microflash/preset */

// 1. Remove default margin in all browsers
// 2. Set `line-height` based on x-height of the font and `font-size` to automatically adjust for all `font-size` values
Expand Down Expand Up @@ -137,6 +137,11 @@
}
}

// Make sure textareas without a rows attribute are not tiny
:where(textarea:not([rows])) {
min-block-size: 10em;
}

// Add explicit cursor to indicate clickable elements
:where(a[href], area, button, input:not([type="text"], [type="email"], [type="file"], [type="number"], [type="password"], [type=""], [type="tel"], [type="url"]), label[for], select, summary, [role="button"], [onclick], [tabindex]:not([tabindex*="-"])),
:where(input[type="file"])::file-selector-button {
Expand Down

0 comments on commit c410da6

Please sign in to comment.