@cssints/reset 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +47 -2
  2. package/dist/groups/baseline-2015/with-downstream.d.mts +5 -0
  3. package/dist/groups/baseline-2015/with-downstream.mjs +6 -0
  4. package/dist/groups/baseline-2015.d.mts +5 -0
  5. package/dist/groups/baseline-2015.mjs +6 -0
  6. package/dist/groups/baseline-2016/with-downstream.d.mts +5 -0
  7. package/dist/groups/baseline-2016/with-downstream.mjs +6 -0
  8. package/dist/groups/baseline-2016.d.mts +5 -0
  9. package/dist/groups/baseline-2016.mjs +6 -0
  10. package/dist/groups/baseline-2017/with-downstream.d.mts +5 -0
  11. package/dist/groups/baseline-2017/with-downstream.mjs +6 -0
  12. package/dist/groups/baseline-2017.d.mts +5 -0
  13. package/dist/groups/baseline-2017.mjs +6 -0
  14. package/dist/groups/baseline-2018/with-downstream.d.mts +5 -0
  15. package/dist/groups/baseline-2018/with-downstream.mjs +6 -0
  16. package/dist/groups/baseline-2018.d.mts +5 -0
  17. package/dist/groups/baseline-2018.mjs +6 -0
  18. package/dist/groups/baseline-2019/with-downstream.d.mts +5 -0
  19. package/dist/groups/baseline-2019/with-downstream.mjs +6 -0
  20. package/dist/groups/baseline-2019.d.mts +5 -0
  21. package/dist/groups/baseline-2019.mjs +6 -0
  22. package/dist/groups/baseline-2020/with-downstream.d.mts +5 -0
  23. package/dist/groups/baseline-2020/with-downstream.mjs +6 -0
  24. package/dist/groups/baseline-2020.d.mts +5 -0
  25. package/dist/groups/baseline-2020.mjs +6 -0
  26. package/dist/groups/baseline-2021/with-downstream.d.mts +5 -0
  27. package/dist/groups/baseline-2021/with-downstream.mjs +6 -0
  28. package/dist/groups/baseline-2021.d.mts +5 -0
  29. package/dist/groups/baseline-2021.mjs +6 -0
  30. package/dist/groups/baseline-2022/with-downstream.d.mts +5 -0
  31. package/dist/groups/baseline-2022/with-downstream.mjs +6 -0
  32. package/dist/groups/baseline-2022.d.mts +5 -0
  33. package/dist/groups/baseline-2022.mjs +6 -0
  34. package/dist/groups/baseline-2023/with-downstream.d.mts +5 -0
  35. package/dist/groups/baseline-2023/with-downstream.mjs +6 -0
  36. package/dist/groups/baseline-2023.d.mts +5 -0
  37. package/dist/groups/baseline-2023.mjs +6 -0
  38. package/dist/groups/baseline-2024/with-downstream.d.mts +5 -0
  39. package/dist/groups/baseline-2024/with-downstream.mjs +6 -0
  40. package/dist/groups/baseline-2024.d.mts +5 -0
  41. package/dist/groups/baseline-2024.mjs +6 -0
  42. package/dist/groups/baseline-2025/with-downstream.d.mts +5 -0
  43. package/dist/groups/baseline-2025/with-downstream.mjs +6 -0
  44. package/dist/groups/baseline-2025.d.mts +5 -0
  45. package/dist/groups/baseline-2025.mjs +6 -0
  46. package/dist/groups/baseline-2026/with-downstream.d.mts +5 -0
  47. package/dist/groups/baseline-2026/with-downstream.mjs +6 -0
  48. package/dist/groups/baseline-2026.d.mts +5 -0
  49. package/dist/groups/baseline-2026.mjs +6 -0
  50. package/dist/groups/limited-availability.d.mts +5 -0
  51. package/dist/groups/limited-availability.mjs +6 -0
  52. package/dist/groups/newly-available/with-downstream.d.mts +5 -0
  53. package/dist/groups/newly-available/with-downstream.mjs +6 -0
  54. package/dist/groups/newly-available.d.mts +5 -0
  55. package/dist/groups/newly-available.mjs +6 -0
  56. package/dist/groups/widely-available/with-downstream.d.mts +5 -0
  57. package/dist/groups/widely-available/with-downstream.mjs +6 -0
  58. package/dist/groups/widely-available.d.mts +5 -0
  59. package/dist/groups/widely-available.mjs +6 -0
  60. package/dist/index.d.mts +5 -11
  61. package/dist/index.mjs +5 -35
  62. package/dist/make-ZkV_V-vR.mjs +53 -0
  63. package/dist/make-vcKtnNcs.d.mts +12 -0
  64. package/package.json +6 -2
package/README.md CHANGED
@@ -34,6 +34,9 @@ reset({ media: true, prose: true });
34
34
  word-spacing: inherit;
35
35
  color: inherit;
36
36
  }
37
+ :where(button, input[type="button"], input[type="submit"], input[type="reset"]) {
38
+ border: 0;
39
+ }
37
40
  :where(p, h1, h2, h3, h4, h5, h6) {
38
41
  overflow-wrap: break-word;
39
42
  }
@@ -75,7 +78,9 @@ reset({ media: true, prose: true });
75
78
  - **The base** is what most modern resets agree on ([Josh Comeau](https://www.joshwcomeau.com/css/custom-css-reset/),
76
79
  [Jake Lazaroff](https://jakelazaroff.com/words/my-modern-css-reset/), [Vale](https://vale.rocks/posts/css-reset)):
77
80
  `border-box`, no margins, a readable line height, no text inflation on mobile, form controls in the page's font and
78
- colour, long words that wrap, balanced headings and paragraphs without orphans. The paddings stay (a list keeps room
81
+ colour, buttons without the border of the browser (its bevel; text fields, text areas and selects keep theirs), long
82
+ words that wrap, balanced headings and paragraphs without orphans. A button keeps the background and the padding of the
83
+ browser (Tailwind's preflight drops the background; this reset does not). The paddings stay (a list keeps room
79
84
  for its markers), and the markers of a list go only with `role="list"` (Andy Bell's), since Safari stops announcing a
80
85
  list that has `list-style: none`.
81
86
  - **`media: true`** makes images, videos, canvases and SVGs blocks that never overflow their container, and keeps the
@@ -91,8 +96,47 @@ reset({ media: true, prose: true });
91
96
  - **Once.** Each block is a global rule identified by its text: `reset()` in two modules, or `reset()` and
92
97
  `reset({ media: true })`, print the base once.
93
98
 
99
+ ## Baseline variants
100
+
101
+ `@cssints/reset` is the whole reset. `@cssints/reset/<group>` is the same call with the declarations of a
102
+ [Baseline group of cssints](../../docs/API.md) only (`inGroup` of `cssints/plugin`, from the group data of cssints):
103
+ `widely-available`, `newly-available`, `baseline-2015` to `baseline-2026` (what was Baseline at the end of that year), and
104
+ each of them `/with-downstream` (also checked against Opera, Samsung Internet, Android WebView, UC and QQ). A
105
+ declaration whose property or value the group does not have is left out, and a rule left with no declaration goes.
106
+ `limited-availability` is everything, as `@cssints/reset`. `not-discouraged` has no variant: it bans three properties and
107
+ four keywords that the reset does not use. A name that is no Baseline group is a type error.
108
+
109
+ ```ts
110
+ import { reset } from "@cssints/reset/widely-available" with { type: "cssints" };
111
+
112
+ reset({ media: true, prose: true });
113
+ ```
114
+
115
+ What each variant drops (written by `node test/reset.mjs --write`, checked by `bun run test`):
116
+
117
+ <!-- variants -->
118
+
119
+ | Dropped | Variants |
120
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
121
+ | nothing | `limited-availability` |
122
+ | `text-size-adjust: none`, `text-wrap: balance`, `text-wrap: pretty` | `widely-available`, `widely-available/with-downstream`, `baseline-2020`, `baseline-2020/with-downstream`, `baseline-2021`, `baseline-2021/with-downstream`, `baseline-2022`, `baseline-2022/with-downstream`, `baseline-2023`, `baseline-2023/with-downstream` |
123
+ | `text-size-adjust: none`, `text-wrap: pretty` | `newly-available`, `newly-available/with-downstream`, `baseline-2024`, `baseline-2024/with-downstream`, `baseline-2025`, `baseline-2025/with-downstream`, `baseline-2026`, `baseline-2026/with-downstream` |
124
+ | `text-size-adjust: none`, `overflow-wrap: break-word`, `text-wrap: balance`, `text-wrap: pretty`, `margin-block-start: 1em`, `max-inline-size: 100%`, `block-size: auto` | `baseline-2015`, `baseline-2015/with-downstream`, `baseline-2016`, `baseline-2016/with-downstream`, `baseline-2017`, `baseline-2017/with-downstream` |
125
+ | `text-size-adjust: none`, `text-wrap: balance`, `text-wrap: pretty`, `margin-block-start: 1em`, `max-inline-size: 100%`, `block-size: auto` | `baseline-2018`, `baseline-2018/with-downstream`, `baseline-2019`, `baseline-2019/with-downstream` |
126
+
127
+ <!-- /variants -->
128
+
129
+ A dropped declaration is not replaced. `text-wrap: balance` and `pretty` are progressive: without them a heading wraps
130
+ as it always did. The unprefixed `text-size-adjust` is only for browsers that do not read `-webkit-text-size-adjust`,
131
+ which every variant keeps (a property cssints has no member for is in every group).
132
+
94
133
  ## Limits
95
134
 
135
+ - **The selectors are not checked.** The group data has the pseudo-classes without arguments (`:hover`), and no
136
+ functional pseudo-class (`:where()`, `:not()`), pseudo-element (`::before`, `::backdrop`), attribute selector or
137
+ combinator. A variant keeps every selector as written, so `baseline-2015` to `baseline-2020` keep rules with `:where()`
138
+ (Baseline 2021) and `:not()` with a selector list, and drop only their declarations.
139
+
96
140
  - `reset` is a contract name: a `layers("reset")` without `before`, or another plugin that declares `reset` after the
97
141
  engine's layers, is a build error.
98
142
  - The rule set is fixed: there is no option per rule. A rule you do not want is overridden by any style of yours.
@@ -100,7 +144,8 @@ reset({ media: true, prose: true });
100
144
  that call it, and leaves with them.
101
145
 
102
146
  ```bash
103
- cd packages/reset && bun run test # fixtures through the engine (the order of the sheet, the flags), and the type test via bun run typecheck
147
+ cd packages/reset && bun run test # fixtures through the engine (the order of the sheet, the flags, each variant), and the type test via bun run typecheck
148
+ cd packages/reset && bun run variants # rewrite src/groups after a bun run groups in packages/cssints
104
149
  ```
105
150
 
106
151
  ## Credits
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2015/with-downstream.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2015/with-downstream only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2015/with-downstream.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2015/with-downstream only (the README has what it drops). */
4
+ const reset = make("baseline-2015/with-downstream");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2015.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2015 only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2015.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2015 only (the README has what it drops). */
4
+ const reset = make("baseline-2015");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2016/with-downstream.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2016/with-downstream only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2016/with-downstream.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2016/with-downstream only (the README has what it drops). */
4
+ const reset = make("baseline-2016/with-downstream");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2016.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2016 only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2016.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2016 only (the README has what it drops). */
4
+ const reset = make("baseline-2016");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2017/with-downstream.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2017/with-downstream only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2017/with-downstream.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2017/with-downstream only (the README has what it drops). */
4
+ const reset = make("baseline-2017/with-downstream");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2017.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2017 only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2017.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2017 only (the README has what it drops). */
4
+ const reset = make("baseline-2017");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2018/with-downstream.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2018/with-downstream only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2018/with-downstream.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2018/with-downstream only (the README has what it drops). */
4
+ const reset = make("baseline-2018/with-downstream");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2018.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2018 only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2018.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2018 only (the README has what it drops). */
4
+ const reset = make("baseline-2018");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2019/with-downstream.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2019/with-downstream only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2019/with-downstream.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2019/with-downstream only (the README has what it drops). */
4
+ const reset = make("baseline-2019/with-downstream");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2019.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2019 only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2019.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2019 only (the README has what it drops). */
4
+ const reset = make("baseline-2019");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2020/with-downstream.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2020/with-downstream only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2020/with-downstream.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2020/with-downstream only (the README has what it drops). */
4
+ const reset = make("baseline-2020/with-downstream");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2020.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2020 only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2020.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2020 only (the README has what it drops). */
4
+ const reset = make("baseline-2020");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2021/with-downstream.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2021/with-downstream only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2021/with-downstream.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2021/with-downstream only (the README has what it drops). */
4
+ const reset = make("baseline-2021/with-downstream");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2021.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2021 only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2021.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2021 only (the README has what it drops). */
4
+ const reset = make("baseline-2021");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2022/with-downstream.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2022/with-downstream only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2022/with-downstream.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2022/with-downstream only (the README has what it drops). */
4
+ const reset = make("baseline-2022/with-downstream");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2022.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2022 only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2022.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2022 only (the README has what it drops). */
4
+ const reset = make("baseline-2022");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2023/with-downstream.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2023/with-downstream only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2023/with-downstream.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2023/with-downstream only (the README has what it drops). */
4
+ const reset = make("baseline-2023/with-downstream");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2023.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2023 only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2023.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2023 only (the README has what it drops). */
4
+ const reset = make("baseline-2023");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2024/with-downstream.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2024/with-downstream only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2024/with-downstream.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2024/with-downstream only (the README has what it drops). */
4
+ const reset = make("baseline-2024/with-downstream");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2024.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2024 only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2024.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2024 only (the README has what it drops). */
4
+ const reset = make("baseline-2024");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2025/with-downstream.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2025/with-downstream only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2025/with-downstream.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2025/with-downstream only (the README has what it drops). */
4
+ const reset = make("baseline-2025/with-downstream");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2025.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2025 only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2025.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2025 only (the README has what it drops). */
4
+ const reset = make("baseline-2025");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2026/with-downstream.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2026/with-downstream only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2026/with-downstream.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2026/with-downstream only (the README has what it drops). */
4
+ const reset = make("baseline-2026/with-downstream");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/baseline-2026.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2026 only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/baseline-2026.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/baseline-2026 only (the README has what it drops). */
4
+ const reset = make("baseline-2026");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/limited-availability.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/limited-availability only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/limited-availability.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/limited-availability only (the README has what it drops). */
4
+ const reset = make("limited-availability");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../../make-vcKtnNcs.mjs";
2
+ //#region src/groups/newly-available/with-downstream.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/newly-available/with-downstream only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/newly-available/with-downstream.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/newly-available/with-downstream only (the README has what it drops). */
4
+ const reset = make("newly-available/with-downstream");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/newly-available.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/newly-available only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/newly-available.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/newly-available only (the README has what it drops). */
4
+ const reset = make("newly-available");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../../make-vcKtnNcs.mjs";
2
+ //#region src/groups/widely-available/with-downstream.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/widely-available/with-downstream only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/widely-available/with-downstream.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/widely-available/with-downstream only (the README has what it drops). */
4
+ const reset = make("widely-available/with-downstream");
5
+ //#endregion
6
+ export { reset };
@@ -0,0 +1,5 @@
1
+ import { t as Reset } from "../make-vcKtnNcs.mjs";
2
+ //#region src/groups/widely-available.d.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/widely-available only (the README has what it drops). */
4
+ export declare const reset: Reset;
5
+ //#endregion
@@ -0,0 +1,6 @@
1
+ import { t as make } from "../make-ZkV_V-vR.mjs";
2
+ //#region src/groups/widely-available.ts
3
+ /** `reset({ media?, prose? })` with the declarations of cssints/widely-available only (the README has what it drops). */
4
+ const reset = make("widely-available");
5
+ //#endregion
6
+ export { reset };
package/dist/index.d.mts CHANGED
@@ -1,19 +1,13 @@
1
+ import { t as Reset } from "./make-vcKtnNcs.mjs";
1
2
  //#region src/index.d.ts
2
- declare const resetScope: import("cssints/plugin").Scope<"reset", {
3
- readonly reset: {
4
- readonly args: readonly [{
5
- readonly "media?": import("cssints/plugin").Typed<boolean>;
6
- readonly "prose?": import("cssints/plugin").Typed<boolean>;
7
- }];
8
- };
9
- }>;
10
3
  /**
11
4
  * `reset({ media?, prose? })`: the reset, in a layer below every other style of the sheet. The base sets `border-box`,
12
5
  * removes the margins, gives `html` a line height of 1.5 and stops mobile text inflation, makes form controls inherit the
13
- * font and colour, wraps long words in text and balances headings, and removes the markers of a list with
6
+ * font and colour, takes the border off buttons, wraps long words in text and balances headings, and removes the markers of a list with
14
7
  * `role="list"`. `media: true` makes images, videos, canvases and SVGs blocks that do not overflow their container;
15
8
  * `prose: true` puts 1em between flow elements (headings, paragraphs, lists, ...) that have no class, as in rendered
16
- * Markdown. Call it at a module's top level; it prints no class.
9
+ * Markdown. Call it at a module's top level; it prints no class. `@cssints/reset/<group>` is the same, with the
10
+ * declarations of a Baseline group only.
17
11
  */
18
- export declare const reset: ReturnType<typeof resetScope.export>["reset"];
12
+ export declare const reset: Reset;
19
13
  //#endregion
package/dist/index.mjs CHANGED
@@ -1,44 +1,14 @@
1
- import { arg, scope } from "cssints/plugin";
1
+ import { t as make } from "./make-ZkV_V-vR.mjs";
2
2
  //#region src/index.ts
3
- const HEADINGS = "h1, h2, h3, h4, h5, h6";
4
- const FLOW = `${HEADINGS}, p, ul, ol, dl, blockquote, pre, figure, table, hr`;
5
- const layered = (rules) => ({
6
- css: rules,
7
- layer: "reset"
8
- });
9
- const BASE = layered([
10
- "*, *::before, *::after { box-sizing: border-box }",
11
- "* { margin: 0 }",
12
- "html { -webkit-text-size-adjust: none; text-size-adjust: none; line-height: 1.5 }",
13
- ":where(input, button, textarea, select) { font: inherit; letter-spacing: inherit; word-spacing: inherit; color: inherit }",
14
- `:where(p, ${HEADINGS}) { overflow-wrap: break-word }`,
15
- `:where(${HEADINGS}) { text-wrap: balance }`,
16
- ":where(p) { text-wrap: pretty }",
17
- ":where(ul, ol)[role=\"list\"] { list-style: none; padding: 0 }"
18
- ].join(" "));
19
- const MEDIA = layered([":where(img, picture, video, canvas, svg) { display: block; max-inline-size: 100% }", ":where(img, video) { block-size: auto }"].join(" "));
20
- const PROSE = layered([`:where(${FLOW}):not([class]) + :where(${FLOW}):not([class]) { margin-block-start: 1em }`, `:where(${HEADINGS}):not([class]) { line-height: 1.25 }`].join(" "));
21
3
  /**
22
4
  * `reset({ media?, prose? })`: the reset, in a layer below every other style of the sheet. The base sets `border-box`,
23
5
  * removes the margins, gives `html` a line height of 1.5 and stops mobile text inflation, makes form controls inherit the
24
- * font and colour, wraps long words in text and balances headings, and removes the markers of a list with
6
+ * font and colour, takes the border off buttons, wraps long words in text and balances headings, and removes the markers of a list with
25
7
  * `role="list"`. `media: true` makes images, videos, canvases and SVGs blocks that do not overflow their container;
26
8
  * `prose: true` puts 1em between flow elements (headings, paragraphs, lists, ...) that have no class, as in rendered
27
- * Markdown. Call it at a module's top level; it prints no class.
9
+ * Markdown. Call it at a module's top level; it prints no class. `@cssints/reset/<group>` is the same, with the
10
+ * declarations of a Baseline group only.
28
11
  */
29
- const reset = scope("reset", { reset: { args: [{
30
- "media?": arg(),
31
- "prose?": arg()
32
- }] } }).build({ reset: (options) => ({
33
- layers: {
34
- layers: ["reset"],
35
- before: true
36
- },
37
- globals: [
38
- BASE,
39
- ...options.media ? [MEDIA] : [],
40
- ...options.prose ? [PROSE] : []
41
- ]
42
- }) }).export().reset;
12
+ const reset = make();
43
13
  //#endregion
44
14
  export { reset };
@@ -0,0 +1,53 @@
1
+ import { arg, inGroup, scope } from "cssints/plugin";
2
+ //#region src/make.ts
3
+ const HEADINGS = "h1, h2, h3, h4, h5, h6";
4
+ const FLOW = `${HEADINGS}, p, ul, ol, dl, blockquote, pre, figure, table, hr`;
5
+ const BASE = [
6
+ ["*, *::before, *::after", [["box-sizing", "border-box"]]],
7
+ ["*", [["margin", "0"]]],
8
+ ["html", [
9
+ ["-webkit-text-size-adjust", "none"],
10
+ ["text-size-adjust", "none"],
11
+ ["line-height", "1.5"]
12
+ ]],
13
+ [":where(input, button, textarea, select)", [
14
+ ["font", "inherit"],
15
+ ["letter-spacing", "inherit"],
16
+ ["word-spacing", "inherit"],
17
+ ["color", "inherit"]
18
+ ]],
19
+ [":where(button, input[type=\"button\"], input[type=\"submit\"], input[type=\"reset\"])", [["border", "0"]]],
20
+ [`:where(p, ${HEADINGS})`, [["overflow-wrap", "break-word"]]],
21
+ [`:where(${HEADINGS})`, [["text-wrap", "balance"]]],
22
+ [":where(p)", [["text-wrap", "pretty"]]],
23
+ [":where(ul, ol)[role=\"list\"]", [["list-style", "none"], ["padding", "0"]]]
24
+ ];
25
+ const MEDIA = [[":where(img, picture, video, canvas, svg)", [["display", "block"], ["max-inline-size", "100%"]]], [":where(img, video)", [["block-size", "auto"]]]];
26
+ const PROSE = [[`:where(${FLOW}):not([class]) + :where(${FLOW}):not([class])`, [["margin-block-start", "1em"]]], [`:where(${HEADINGS}):not([class])`, [["line-height", "1.25"]]]];
27
+ const layered = (rules, group) => {
28
+ const css = rules.flatMap(([selector, declarations]) => {
29
+ const kept = declarations.filter(([p, v]) => !group || inGroup(group, p, v));
30
+ return kept.length ? [`${selector} { ${kept.map(([p, v]) => `${p}: ${v}`).join("; ")} }`] : [];
31
+ }).join(" ");
32
+ return css ? [{
33
+ css,
34
+ layer: "reset"
35
+ }] : [];
36
+ };
37
+ const define = (group) => scope("reset", { reset: { args: [{
38
+ "media?": arg(),
39
+ "prose?": arg()
40
+ }] } }).build({ reset: (options) => ({
41
+ layers: {
42
+ layers: ["reset"],
43
+ before: true
44
+ },
45
+ globals: [
46
+ ...layered(BASE, group),
47
+ ...options.media ? layered(MEDIA, group) : [],
48
+ ...options.prose ? layered(PROSE, group) : []
49
+ ]
50
+ }) });
51
+ const make = (group) => define(group).export().reset;
52
+ //#endregion
53
+ export { make as t };
@@ -0,0 +1,12 @@
1
+ //#region src/make.d.ts
2
+ declare const define: (group?: string) => import("cssints/plugin").Scope<"reset", {
3
+ readonly reset: {
4
+ readonly args: readonly [{
5
+ readonly "media?": import("cssints/plugin").Typed<boolean>;
6
+ readonly "prose?": import("cssints/plugin").Typed<boolean>;
7
+ }];
8
+ };
9
+ }>;
10
+ type Reset = ReturnType<ReturnType<typeof define>["export"]>["reset"];
11
+ //#endregion
12
+ export { Reset as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cssints/reset",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "A small modern CSS reset for cssints, in a layer below every style",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -18,10 +18,14 @@
18
18
  ".": {
19
19
  "types": "./dist/index.d.mts",
20
20
  "default": "./dist/index.mjs"
21
+ },
22
+ "./*": {
23
+ "types": "./dist/groups/*.d.mts",
24
+ "default": "./dist/groups/*.mjs"
21
25
  }
22
26
  },
23
27
  "peerDependencies": {
24
- "cssints": "^0.2.0"
28
+ "cssints": "^0.3.0"
25
29
  },
26
30
  "engines": {
27
31
  "node": ">=22"