@anyblades/blades 3.1.0-alpha.2 → 3.1.0-beta.4

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 (93) hide show
  1. package/README.md +48 -23
  2. package/css/blades.css +301 -593
  3. package/css/blades.min.css +4 -148
  4. package/css/blades.ninja.css +4204 -0
  5. package/css/blades.ninja.min.css +12 -0
  6. package/css/float-label.css +207 -0
  7. package/css/float-label.min.css +6 -0
  8. package/css/{pico.layered.css → layered/blades.layered.css} +589 -17
  9. package/css/layered/blades.layered.min.css +14 -0
  10. package/css/layered/compact.css +54 -0
  11. package/css/layered/components/accordion.css +85 -0
  12. package/css/layered/components/card.css +48 -0
  13. package/css/layered/components/dropdown.css +191 -0
  14. package/css/layered/components/group.css +208 -0
  15. package/css/layered/components/loading.css +61 -0
  16. package/css/layered/components/modal.css +158 -0
  17. package/css/layered/components/nav.css +117 -0
  18. package/css/layered/components/progress.css +76 -0
  19. package/css/layered/components/tooltip.css +176 -0
  20. package/css/layered/components.css +1099 -0
  21. package/css/layered/content/button.css +208 -0
  22. package/css/layered/content/code.css +64 -0
  23. package/css/layered/content/embedded-content.css +41 -0
  24. package/css/layered/content/figure.css +15 -0
  25. package/css/layered/content/link.css +84 -0
  26. package/css/layered/content/misc.css +22 -0
  27. package/css/layered/content/table.css +33 -0
  28. package/css/layered/content/typography.css +159 -0
  29. package/css/layered/content.css +611 -0
  30. package/css/layered/forms/basics.css +338 -0
  31. package/css/layered/forms/checkbox-radio-switch.css +164 -0
  32. package/css/layered/forms/input-color.css +20 -0
  33. package/css/layered/forms/input-datetime.css +57 -0
  34. package/css/layered/forms/input-file.css +29 -0
  35. package/css/layered/forms/input-range.css +121 -0
  36. package/css/layered/forms/input-search.css +66 -0
  37. package/css/layered/forms.css +778 -0
  38. package/css/layered/layout/container.css +42 -0
  39. package/css/layered/layout/document.css +48 -0
  40. package/css/layered/layout/grid.css +22 -0
  41. package/css/layered/layout/landmarks.css +12 -0
  42. package/css/layered/layout/overflow-auto.css +9 -0
  43. package/css/layered/layout/section.css +9 -0
  44. package/css/layered/layout.css +119 -0
  45. package/css/layered/utilities.css +35 -0
  46. package/css/layered/variables.css +365 -0
  47. package/css/pico.conditional.css +34 -16
  48. package/css/pico.conditional.min.css +2 -111
  49. package/css/pico.css +34 -16
  50. package/css/pico.min.css +2 -111
  51. package/package.json +16 -12
  52. package/src/blades/_compact.css +51 -0
  53. package/src/blades/_dropdown-popover.css +107 -0
  54. package/src/blades/_index.css +28 -0
  55. package/src/blades/_modal.css +26 -0
  56. package/src/blades/float-label/_index.css +2 -0
  57. package/src/{standalone/forms/_float-label.theme.css → blades/float-label/_theme.css} +5 -1
  58. package/src/blades.css +2 -2
  59. package/src/blades.ninja.css +3 -0
  60. package/src/float-label.css +1 -0
  61. package/src/ninja/LICENSE +22 -0
  62. package/src/ninja/README.md +1 -0
  63. package/src/ninja/_index.css +19 -0
  64. package/src/{standalone → ninja}/_theme.css +0 -2
  65. package/src/{ninja.css → ninja/_utilities.css} +55 -6
  66. package/src/pico/_variables.css +6 -5
  67. package/src/pico/components/_loading.css +27 -1
  68. package/src/pico/content/_button.css +1 -1
  69. package/src/pico/layout/_document.css +9 -0
  70. package/src/pico/layout/_index.css +0 -1
  71. package/src/pico/layout/_landmarks.css +1 -9
  72. package/src/pico.css +1 -0
  73. package/css/blades.standalone.css +0 -860
  74. package/css/blades.standalone.min.css +0 -37
  75. package/css/ninja.css +0 -83
  76. package/css/ninja.min.css +0 -5
  77. package/css/pico.layered.min.css +0 -118
  78. package/src/blades.standalone.css +0 -2
  79. package/src/standalone/_core.css +0 -32
  80. package/src/standalone/_utilities.css +0 -55
  81. package/src/standalone/forms/_float-label.css +0 -2
  82. /package/src/{standalone/content → blades}/_code.css +0 -0
  83. /package/src/{standalone/layout → blades}/_columns.css +0 -0
  84. /package/src/{standalone/components/_icon-helper.css → blades/_icon.css} +0 -0
  85. /package/src/{standalone/components → blades}/_timeline.css +0 -0
  86. /package/src/{standalone → blades}/_variables.css +0 -0
  87. /package/src/{standalone/forms/_float-label.core.css → blades/float-label/_core.css} +0 -0
  88. /package/src/{standalone/layout/_breakout.css → ninja/_container-breakout.css} +0 -0
  89. /package/src/{standalone/content/_typography.css → ninja/_heading-anchor.css} +0 -0
  90. /package/src/{standalone/content/_list.css → ninja/_list-helpers.css} +0 -0
  91. /package/src/{standalone/layout/_scroller.css → ninja/_page-anchors.css} +0 -0
  92. /package/src/{standalone/content/_table.css → ninja/_table-helpers.css} +0 -0
  93. /package/src/{standalone/content → ninja}/_table-responsive.css +0 -0
package/README.md CHANGED
@@ -8,7 +8,6 @@
8
8
 
9
9
  <big>Fully compatible and actively maintained successor to [Pico CSS](https://picocss.com/).</big>
10
10
 
11
- Introduces [float labels](//blades.ninja/css/float-label/), [breakout container](//blades.ninja/css/breakout/) and other modern, opt-out [helpers](//blades.ninja/#docs).
12
11
  Simply switch `pico.css` to `blades.css` OR use `blades.standalone.css` with other frameworks.
13
12
 
14
13
  <nav>
@@ -50,7 +49,7 @@ Live example: https://github.com/pallets/website/blob/main/src/pallets/templates
50
49
 
51
50
  Full list of CSS files available on CDN: https://cdn.jsdelivr.net/npm/@anyblades/blades@3/css/
52
51
 
53
- `pico.layered.min.css` is Pico wrapped in `@layer pico { }`, so any unlayered styles of yours win over it without specificity fights. Note that inside a layer Pico's own `!important` declarations (form validation, reduced motion) beat your unlayered `!important`, and your `@keyframes` of the same name as Pico's win regardless of load order. When you can use `@import`, `@import url("…/pico.min.css") layer(pico);` does the same without this file.
52
+ `blades.layered.min.css` is Blades wrapped in `@layer blades { }`, so any unlayered styles of yours win over it without specificity fights. Note that inside a layer Blades' own `!important` declarations (form validation, reduced motion) beat your unlayered `!important`, and your `@keyframes` of the same name as Blades' win regardless of load order. When you can use `@import`, `@import url("…/blades.min.css") layer(blades);` does the same without this file.
54
53
 
55
54
  ### <mark>C.</mark> Install with NPM
56
55
 
@@ -82,35 +81,46 @@ Or import only the [Pico CSS](//blades.ninja/css/pico/) parts you need, e.g. per
82
81
  @import "@anyblades/blades/pico/variables";
83
82
  @import "@anyblades/blades/pico/layout/document";
84
83
  @import "@anyblades/blades/pico/content/typography";
84
+ @import "@anyblades/blades/pico/components/card";
85
85
  @import "@anyblades/blades/pico/components/modal";
86
86
  ```
87
87
 
88
88
  - `variables` and `layout/document` are the minimum; keep the same order as [`src/pico/_index.css`](https://github.com/anyblades/blades/blob/main/src/pico/_index.css) (variables → layout → content → forms → components → utilities).
89
- - Some parts build on others, e.g. `components/group` and `components/dropdown` expect `forms/basics` and `content/button`.
89
+ - `layout` doesn't pad `body > header/main/footer`. Add `layout/landmarks` for Pico's behaviour.
90
+ - Some parts build on others, e.g. `components/modal` expects `components/card`, and `components/group` and `components/dropdown` expect `forms/basics` and `content/button`.
90
91
  - Available parts are the files under [`src/pico/`](https://github.com/anyblades/blades/tree/main/src/pico): `layout/*`, `content/*`, `forms/*`, `components/*` (or a whole category, e.g. `@anyblades/blades/pico/components`) and `utilities`.
91
92
 
92
93
  #### With bundlers and component frameworks (SvelteKit, Next.js, Nuxt, Astro, …)
93
94
 
94
- Import the parts from JavaScript, i.e. the root layout and the components that use them, rather than with `@import` inside a component's `<style>` block:
95
+ Import the parts from JavaScript, i.e. the root layout and the components that use them, rather than with `@import` inside a component's `<style>` block. Use the layered parts, `@anyblades/blades/layered/*`: they are the same parts wrapped in `@layer blades`, which a JS `import` can't add by itself.
95
96
 
96
97
  ```js
97
- // root layout, once
98
- import "@anyblades/blades/pico/variables";
99
- import "@anyblades/blades/pico/layout/document";
98
+ // root layout, once: the base and every part that others build on
99
+ import "@anyblades/blades/layered/variables";
100
+ import "@anyblades/blades/layered/layout/document";
101
+ import "@anyblades/blades/layered/content/typography";
102
+ import "@anyblades/blades/layered/content/button";
103
+ import "@anyblades/blades/layered/forms/basics";
100
104
 
101
105
  // in the component that renders a <dialog>
102
- import "@anyblades/blades/pico/components/modal";
106
+ import "@anyblades/blades/layered/components/card";
107
+ import "@anyblades/blades/layered/components/modal";
108
+ ```
109
+
110
+ ```html
111
+ <style>
112
+ /* unlayered, so it wins over Blades whatever the specificity (except Blades' !important) */
113
+ article {
114
+ max-width: 40rem;
115
+ }
116
+ </style>
103
117
  ```
104
118
 
105
119
  - Bundlers dedupe JS-side CSS imports and split them per route, so each part is downloaded and cached once and only where it's used.
120
+ - Override in your component's `<style>` or `app.css`, or set `--pico-*` variables on `:root` or on an element. Unlayered CSS always wins over `@layer blades`. The usual layer caveats apply: Blades' own `!important` declarations beat yours, and if you use other layered CSS, declare the order once, before anything else is loaded. For Tailwind v4 that is `@layer theme, base, blades, components, utilities;` at the top of the CSS file you import first (before `@import "tailwindcss"`), and that file has to be imported before any `layered/*` part, because the first `@layer` the browser sees fixes the order.
121
+ - Parts don't `@import` the parts they build on (e.g. `components/modal` expects `components/card`, `components/group` and `components/dropdown` expect `content/button` and `forms/basics`, and the `forms/*` extras expect `forms/basics`). If they did, every route chunk would carry its own copy. Import those shared parts once, at the root or next to the part that needs them; bundlers dedupe the imports.
106
122
  - An `@import` inside a scoped `<style>` (Svelte, Astro, Vue `scoped`) is processed as that component's own styles. The rules get scoped to the component's markup (Svelte also prunes the unused ones) and are duplicated in every component that imports them.
107
- - Pico's landmark padding uses `body > header`, `body > main` and `body > footer`. These don't match when the framework wraps the page in an element: SvelteKit's `<div style="display: contents">`, Next.js pages router `#__next`, Nuxt `#__nuxt`, or a SPA's `#root` / `#app`. Next.js App Router doesn't wrap the page. If you rely on the padding, add it for your wrapper, e.g.:
108
-
109
- ```css
110
- #__next > :is(header, main, footer) {
111
- padding-block: var(--pico-block-spacing-vertical);
112
- }
113
- ```
123
+ - Landmark padding: `pico.css` and `blades.ninja.css` pad `body > header`, `body > main` and `body > footer` like Pico, which doesn't match when the framework wraps the page in an element (SvelteKit's `<div style="display: contents">`, Next.js pages router `#__next`, Nuxt `#__nuxt`, a SPA's `#root` / `#app`). `blades.css` doesn't pad them; with per-part imports, add `layout/landmarks` (or `layered/layout/landmarks`) for Pico's `body >` padding.
114
124
 
115
125
  ### <mark>D.</mark> Official starters
116
126
 
@@ -169,6 +179,26 @@ If you persist the user's choice, e.g. under the `localStorage` key `theme`, set
169
179
 
170
180
  ---
171
181
 
182
+ ## Compact sizing (opt-in)
183
+
184
+ Add `<html data-compact>` for the whole page, or put the attribute on a single element, e.g. `<form data-compact>` for one form. Without the attribute nothing changes.
185
+
186
+ - **Where it ships:**
187
+ - included in `blades.css`
188
+ - also in `blades.layered.css`
189
+ - with per-part imports, add `@import "@anyblades/blades/compact";` after the other parts, or `import "@anyblades/blades/layered/compact";` with the layered parts
190
+ - with `pico.conditional.css`, add `@anyblades/blades/compact` after it
191
+ - **What changes:**
192
+ - smaller control padding and 1.5rem block spacing
193
+ - a 0.5rem radius and a 3px focus ring
194
+ - 500-weight labels and buttons, 600-weight headings
195
+ - a white field background in light mode
196
+ - a 1px card ring instead of the blurred shadow, with no grey card header/footer bands
197
+ - **Root font size:** on `<html>`, it also keeps the root font size at 100% instead of growing with the viewport. At 1280px wide, controls are then 38px instead of 62px. On a single element they are about 48px, because everything is sized in `rem` and the root stays as it is.
198
+ - **Field text size:** form controls stay at 16px, because below that iOS Safari zooms in on focus.
199
+
200
+ ---
201
+
172
202
  ## Documentation
173
203
 
174
204
  <!-- ToC as is from https://blades.ninja/#docs -->
@@ -260,6 +290,7 @@ If you persist the user's choice, e.g. under the `localStorage` key `theme`, set
260
290
  ## <sup style>Featured by</sup> <!-- [1] big projects [2] awesome [3] smaller projects [4] blogs/social -->
261
291
 
262
292
  - [getgrav.org](https://getgrav.org/migrate-to-2#:~:text=blades)
293
+ - https://usehadron.dev/
263
294
  - [@11ty/buildawesome](https://bsky.app/profile/11ty.dev/post/3mp75r53ccv2b) [↗](https://mastodon.social/@11ty@neighborhood.11ty.dev/116816881367741413)
264
295
  - [<i class="fa-brands fa-build-awesome mark-brand"></i> buildawesome.one](https://buildawesome.one/#:~:text=blades)
265
296
  - https://github.com/dbohdan/classless-css
@@ -267,7 +298,8 @@ If you persist the user's choice, e.g. under the `localStorage` key `theme`, set
267
298
  - [/gabrielizalo/awesome-css-frameworks](https://github.com/gabrielizalo/awesome-css-frameworks-and-ui-libraries/tree/master/Lightweight)
268
299
  - https://github.com/eggplantpasta/greenroom
269
300
  - [/adamdjbrett/11ty-wisp](https://github.com/adamdjbrett/11ty-wisp#features:~:text=blades) [↗](https://github.com/adamdjbrett/000000076#:~:text=blades)
270
- - [doany.io](https://doany.io/en/posts/svelte-bun-sqlite/#on-biome-and-css)
301
+ - [doany.io](https://doany.io/en/posts/svelte-bun-sqlite/#on-biome-and-css:~:text=anyblades)
302
+ - [@box464](https://mastodon.social/@box464/117442493473921346)
271
303
  - [@draupnerdata](https://www.youtube.com/watch?v=yDjArj9HSjs&t=180s)
272
304
  - [@cantdutchthis](https://news.ycombinator.com/item?id=48729467)
273
305
  - [@daviding](https://www.reddit.com/r/Wordpress/comments/1vnfhkr/comment/p3k9z1c/#:~:text=blades)
@@ -278,10 +310,3 @@ If you persist the user's choice, e.g. under the `localStorage` key `theme`, set
278
310
 
279
311
  <!--{.markerless .columns}-->
280
312
  <!--[hostfurl.com, @johnheenan]-->
281
-
282
- ## <sup style>Credits</sup>
283
-
284
- - https://picocss.com/ for [inspiration](//blades.ninja/css/pico/)
285
- - https://11ty.dev/ for [site generation](//buildawesome.one/)
286
-
287
- <!--{.markerless}-->