@bwui/css 0.1.0 → 0.1.3
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.
- package/LICENSE +21 -0
- package/README.md +40 -0
- package/dist/brickwork.css +119 -8
- package/package.json +9 -3
- package/src/document-a11y.css +33 -0
- package/src/index-extras.css +70 -0
- package/src/wave-e.css +9 -7
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nigel Copley
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `@bwui/css`
|
|
2
|
+
|
|
3
|
+
Framework-agnostic Brickwork primitives and component classes. Consumes
|
|
4
|
+
`@bwui/tokens`. Works with plain HTML, React, Vue, or Django. No JavaScript
|
|
5
|
+
required for the stylesheet itself.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @bwui/css
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import "@bwui/css";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<link rel="stylesheet" href="node_modules/@bwui/css/dist/brickwork.css" />
|
|
17
|
+
<body data-theme="light">
|
|
18
|
+
<button class="bw-btn bw-btn--primary">Save</button>
|
|
19
|
+
</body>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For gallery pages that need combobox, date picker, CMDK, modal or toast,
|
|
23
|
+
also install `@bwui/js` and load `behaviours.js`.
|
|
24
|
+
|
|
25
|
+
## Contract
|
|
26
|
+
|
|
27
|
+
- Classes are `bw-*`. Do not style against them from a consumer brand sheet.
|
|
28
|
+
- Recolour by overriding `--bw-*` tokens after this stylesheet.
|
|
29
|
+
- A Django site on `django-brickwork` already vendors this CSS. Do not npm
|
|
30
|
+
`@bwui/css` there just to style the host.
|
|
31
|
+
|
|
32
|
+
## Stack mates
|
|
33
|
+
|
|
34
|
+
- Tokens: `@bwui/tokens`
|
|
35
|
+
- HTML behaviours: `@bwui/js`
|
|
36
|
+
- React: `@bwui/react` (peer CSS is this package)
|
|
37
|
+
- Django: `django-brickwork` on PyPI
|
|
38
|
+
|
|
39
|
+
Agents: do not invent `bw-*` class names. Copy a gallery page or a React
|
|
40
|
+
export, then read the installed CSS. Catalogue: https://brickworkui.com/catalog.json
|
package/dist/brickwork.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Brickwork CSS v0.1.0
|
|
3
3
|
* Framework-agnostic UI substrate. Generated by @bwui/css build.
|
|
4
|
-
* Layers: tokens -> reset -> primitives -> layout -> shell -> nav -> components -> marketing -> wave-b -> wave-e
|
|
4
|
+
* Layers: tokens -> reset -> primitives -> layout -> shell -> nav -> components -> marketing -> wave-b -> wave-e -> index-extras -> document-a11y
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/* ==== layer: tokens ==== */
|
|
@@ -13663,22 +13663,133 @@ same pattern as .bw-bio__profile-link. */
|
|
|
13663
13663
|
border-radius: var(--bw-radius-md);
|
|
13664
13664
|
}
|
|
13665
13665
|
|
|
13666
|
-
.bw-sparkline
|
|
13666
|
+
/* Demo bar chart only. Must not use .bw-sparkline: that class belongs to the
|
|
13667
|
+
* product sparkline component in layers/components.css (brickwork#11). */
|
|
13668
|
+
.bw-demo-barchart {
|
|
13667
13669
|
display: flex;
|
|
13668
13670
|
align-items: flex-end;
|
|
13669
13671
|
gap: 0.35rem;
|
|
13670
13672
|
block-size: 4rem;
|
|
13671
13673
|
}
|
|
13672
13674
|
|
|
13673
|
-
.bw-
|
|
13675
|
+
.bw-demo-barchart > span {
|
|
13674
13676
|
flex: 1;
|
|
13675
13677
|
background: var(--bw-color-accent);
|
|
13676
13678
|
border-radius: 2px 2px 0 0;
|
|
13677
13679
|
opacity: 0.85;
|
|
13678
13680
|
}
|
|
13679
13681
|
|
|
13680
|
-
.bw-
|
|
13681
|
-
.bw-
|
|
13682
|
-
.bw-
|
|
13683
|
-
.bw-
|
|
13684
|
-
.bw-
|
|
13682
|
+
.bw-demo-barchart > span:nth-child(1) { block-size: 35%; }
|
|
13683
|
+
.bw-demo-barchart > span:nth-child(2) { block-size: 55%; }
|
|
13684
|
+
.bw-demo-barchart > span:nth-child(3) { block-size: 40%; }
|
|
13685
|
+
.bw-demo-barchart > span:nth-child(4) { block-size: 75%; }
|
|
13686
|
+
.bw-demo-barchart > span:nth-child(5) { block-size: 60%; }
|
|
13687
|
+
|
|
13688
|
+
|
|
13689
|
+
/* ==== layer: index-extras ==== */
|
|
13690
|
+
/*
|
|
13691
|
+
* Django index extras (icvoss/brickwork#11).
|
|
13692
|
+
*
|
|
13693
|
+
* Previously appended by django-brickwork's vendor-bwui.mjs from
|
|
13694
|
+
* frontend/src/index.css after stripping @imports. Shipped in @bwui/css so
|
|
13695
|
+
* every stack gets the same a11y/RTL floor without a Django-only overlay.
|
|
13696
|
+
*
|
|
13697
|
+
* Source twin: src/layers/_index-reference.css (keeps the documented import
|
|
13698
|
+
* order for Django Vite consumers; this file is the import-free slice the
|
|
13699
|
+
* plain CSS bundle concatenates).
|
|
13700
|
+
*/
|
|
13701
|
+
|
|
13702
|
+
/* Scoped box-sizing reset: the library must be correct without a consumer preflight. */
|
|
13703
|
+
[class^="bw-"],
|
|
13704
|
+
[class*=" bw-"] {
|
|
13705
|
+
box-sizing: border-box;
|
|
13706
|
+
}
|
|
13707
|
+
|
|
13708
|
+
/* Scoped hidden floor: the interaction set toggles the hidden ATTRIBUTE on
|
|
13709
|
+
* elements whose component class sets display, and any author display rule
|
|
13710
|
+
* outranks the UA sheet's [hidden]. */
|
|
13711
|
+
[class^="bw-"][hidden],
|
|
13712
|
+
[class*=" bw-"][hidden] {
|
|
13713
|
+
display: none !important;
|
|
13714
|
+
}
|
|
13715
|
+
|
|
13716
|
+
/* Skip link: visually hidden until focused, then pinned to the top-inline-start. */
|
|
13717
|
+
.bw-skip-link {
|
|
13718
|
+
position: absolute;
|
|
13719
|
+
inset-block-start: 0;
|
|
13720
|
+
inset-inline-start: 0;
|
|
13721
|
+
transform: translateY(-100%);
|
|
13722
|
+
padding: var(--bw-space-2) var(--bw-space-4);
|
|
13723
|
+
background: var(--bw-color-surface);
|
|
13724
|
+
color: var(--bw-color-accent);
|
|
13725
|
+
border: var(--bw-size-border-hairline) solid var(--bw-color-border);
|
|
13726
|
+
border-start-start-radius: 0;
|
|
13727
|
+
border-end-end-radius: var(--bw-radius-md);
|
|
13728
|
+
z-index: var(--bw-z-skip-link);
|
|
13729
|
+
transition: transform var(--bw-duration-fast) var(--bw-ease-out);
|
|
13730
|
+
}
|
|
13731
|
+
.bw-skip-link:focus {
|
|
13732
|
+
transform: translateY(0);
|
|
13733
|
+
}
|
|
13734
|
+
|
|
13735
|
+
.bw-icon {
|
|
13736
|
+
display: inline-block;
|
|
13737
|
+
flex-shrink: 0;
|
|
13738
|
+
vertical-align: middle;
|
|
13739
|
+
inline-size: var(--bw-icon-size, var(--bw-component-icon-size-md));
|
|
13740
|
+
block-size: var(--bw-icon-size, var(--bw-component-icon-size-md));
|
|
13741
|
+
}
|
|
13742
|
+
[dir="rtl"] .bw-icon-directional {
|
|
13743
|
+
transform: scaleX(-1);
|
|
13744
|
+
}
|
|
13745
|
+
|
|
13746
|
+
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
|
|
13747
|
+
outline: var(--bw-focus-ring-width) var(--bw-focus-ring-style) var(--bw-color-focus-ring);
|
|
13748
|
+
outline-offset: var(--bw-focus-ring-offset);
|
|
13749
|
+
}
|
|
13750
|
+
|
|
13751
|
+
@media (prefers-reduced-motion: reduce) {
|
|
13752
|
+
*,
|
|
13753
|
+
*::before,
|
|
13754
|
+
*::after {
|
|
13755
|
+
animation-duration: 0.001ms !important;
|
|
13756
|
+
animation-iteration-count: 1 !important;
|
|
13757
|
+
transition-duration: 0.001ms !important;
|
|
13758
|
+
}
|
|
13759
|
+
}
|
|
13760
|
+
|
|
13761
|
+
|
|
13762
|
+
/* ==== layer: document-a11y ==== */
|
|
13763
|
+
/*
|
|
13764
|
+
* Document-level a11y repairs (icvoss/brickwork#11).
|
|
13765
|
+
*
|
|
13766
|
+
* Previously django-brickwork frontend/src/vendor-overlays.css. Folded into
|
|
13767
|
+
* @bwui/css so pip and npm consumers share one substrate.
|
|
13768
|
+
*/
|
|
13769
|
+
|
|
13770
|
+
/* Native form controls inherit --bw-color-fg but keep the UA light fill unless
|
|
13771
|
+
* the document declares a dark color-scheme. */
|
|
13772
|
+
[data-theme="light"] {
|
|
13773
|
+
color-scheme: light;
|
|
13774
|
+
}
|
|
13775
|
+
[data-theme="dark"] {
|
|
13776
|
+
color-scheme: dark;
|
|
13777
|
+
}
|
|
13778
|
+
|
|
13779
|
+
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(
|
|
13780
|
+
[type="file"]
|
|
13781
|
+
):not([type="hidden"]):not([type="submit"]):not([type="button"]):not(
|
|
13782
|
+
[type="reset"]
|
|
13783
|
+
):not([type="image"]):not([type="color"]),
|
|
13784
|
+
textarea,
|
|
13785
|
+
select {
|
|
13786
|
+
background-color: var(--bw-color-surface);
|
|
13787
|
+
color: var(--bw-color-fg);
|
|
13788
|
+
}
|
|
13789
|
+
|
|
13790
|
+
/* The reset sets a { text-decoration: none }. Bare inline links then fail
|
|
13791
|
+
* WCAG 1.4.1 in dark theme. Classed chrome that wants no underline
|
|
13792
|
+
* (.bw-btn, .bw-nav__link) still wins on specificity. */
|
|
13793
|
+
a {
|
|
13794
|
+
text-decoration: underline;
|
|
13795
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bwui/css",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Framework-agnostic Brickwork primitives and component classes. Consumes @bwui/tokens and works with plain HTML, Django, or any framework — no JavaScript required.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
],
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
|
-
"src"
|
|
12
|
+
"src",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
13
15
|
],
|
|
14
16
|
"exports": {
|
|
15
17
|
".": "./dist/brickwork.css",
|
|
@@ -19,11 +21,15 @@
|
|
|
19
21
|
"./src/*": "./src/*"
|
|
20
22
|
},
|
|
21
23
|
"dependencies": {
|
|
22
|
-
"@bwui/tokens": "0.1.
|
|
24
|
+
"@bwui/tokens": "0.1.3"
|
|
23
25
|
},
|
|
24
26
|
"devDependencies": {
|
|
25
27
|
"tsx": "^4.19.2"
|
|
26
28
|
},
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/icvoss/brickwork.git"
|
|
32
|
+
},
|
|
27
33
|
"publishConfig": {
|
|
28
34
|
"access": "public"
|
|
29
35
|
},
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Document-level a11y repairs (icvoss/brickwork#11).
|
|
3
|
+
*
|
|
4
|
+
* Previously django-brickwork frontend/src/vendor-overlays.css. Folded into
|
|
5
|
+
* @bwui/css so pip and npm consumers share one substrate.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/* Native form controls inherit --bw-color-fg but keep the UA light fill unless
|
|
9
|
+
* the document declares a dark color-scheme. */
|
|
10
|
+
[data-theme="light"] {
|
|
11
|
+
color-scheme: light;
|
|
12
|
+
}
|
|
13
|
+
[data-theme="dark"] {
|
|
14
|
+
color-scheme: dark;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(
|
|
18
|
+
[type="file"]
|
|
19
|
+
):not([type="hidden"]):not([type="submit"]):not([type="button"]):not(
|
|
20
|
+
[type="reset"]
|
|
21
|
+
):not([type="image"]):not([type="color"]),
|
|
22
|
+
textarea,
|
|
23
|
+
select {
|
|
24
|
+
background-color: var(--bw-color-surface);
|
|
25
|
+
color: var(--bw-color-fg);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* The reset sets a { text-decoration: none }. Bare inline links then fail
|
|
29
|
+
* WCAG 1.4.1 in dark theme. Classed chrome that wants no underline
|
|
30
|
+
* (.bw-btn, .bw-nav__link) still wins on specificity. */
|
|
31
|
+
a {
|
|
32
|
+
text-decoration: underline;
|
|
33
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Django index extras (icvoss/brickwork#11).
|
|
3
|
+
*
|
|
4
|
+
* Previously appended by django-brickwork's vendor-bwui.mjs from
|
|
5
|
+
* frontend/src/index.css after stripping @imports. Shipped in @bwui/css so
|
|
6
|
+
* every stack gets the same a11y/RTL floor without a Django-only overlay.
|
|
7
|
+
*
|
|
8
|
+
* Source twin: src/layers/_index-reference.css (keeps the documented import
|
|
9
|
+
* order for Django Vite consumers; this file is the import-free slice the
|
|
10
|
+
* plain CSS bundle concatenates).
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/* Scoped box-sizing reset: the library must be correct without a consumer preflight. */
|
|
14
|
+
[class^="bw-"],
|
|
15
|
+
[class*=" bw-"] {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Scoped hidden floor: the interaction set toggles the hidden ATTRIBUTE on
|
|
20
|
+
* elements whose component class sets display, and any author display rule
|
|
21
|
+
* outranks the UA sheet's [hidden]. */
|
|
22
|
+
[class^="bw-"][hidden],
|
|
23
|
+
[class*=" bw-"][hidden] {
|
|
24
|
+
display: none !important;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Skip link: visually hidden until focused, then pinned to the top-inline-start. */
|
|
28
|
+
.bw-skip-link {
|
|
29
|
+
position: absolute;
|
|
30
|
+
inset-block-start: 0;
|
|
31
|
+
inset-inline-start: 0;
|
|
32
|
+
transform: translateY(-100%);
|
|
33
|
+
padding: var(--bw-space-2) var(--bw-space-4);
|
|
34
|
+
background: var(--bw-color-surface);
|
|
35
|
+
color: var(--bw-color-accent);
|
|
36
|
+
border: var(--bw-size-border-hairline) solid var(--bw-color-border);
|
|
37
|
+
border-start-start-radius: 0;
|
|
38
|
+
border-end-end-radius: var(--bw-radius-md);
|
|
39
|
+
z-index: var(--bw-z-skip-link);
|
|
40
|
+
transition: transform var(--bw-duration-fast) var(--bw-ease-out);
|
|
41
|
+
}
|
|
42
|
+
.bw-skip-link:focus {
|
|
43
|
+
transform: translateY(0);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.bw-icon {
|
|
47
|
+
display: inline-block;
|
|
48
|
+
flex-shrink: 0;
|
|
49
|
+
vertical-align: middle;
|
|
50
|
+
inline-size: var(--bw-icon-size, var(--bw-component-icon-size-md));
|
|
51
|
+
block-size: var(--bw-icon-size, var(--bw-component-icon-size-md));
|
|
52
|
+
}
|
|
53
|
+
[dir="rtl"] .bw-icon-directional {
|
|
54
|
+
transform: scaleX(-1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
|
|
58
|
+
outline: var(--bw-focus-ring-width) var(--bw-focus-ring-style) var(--bw-color-focus-ring);
|
|
59
|
+
outline-offset: var(--bw-focus-ring-offset);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media (prefers-reduced-motion: reduce) {
|
|
63
|
+
*,
|
|
64
|
+
*::before,
|
|
65
|
+
*::after {
|
|
66
|
+
animation-duration: 0.001ms !important;
|
|
67
|
+
animation-iteration-count: 1 !important;
|
|
68
|
+
transition-duration: 0.001ms !important;
|
|
69
|
+
}
|
|
70
|
+
}
|
package/src/wave-e.css
CHANGED
|
@@ -160,22 +160,24 @@
|
|
|
160
160
|
border-radius: var(--bw-radius-md);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
.bw-sparkline
|
|
163
|
+
/* Demo bar chart only. Must not use .bw-sparkline: that class belongs to the
|
|
164
|
+
* product sparkline component in layers/components.css (brickwork#11). */
|
|
165
|
+
.bw-demo-barchart {
|
|
164
166
|
display: flex;
|
|
165
167
|
align-items: flex-end;
|
|
166
168
|
gap: 0.35rem;
|
|
167
169
|
block-size: 4rem;
|
|
168
170
|
}
|
|
169
171
|
|
|
170
|
-
.bw-
|
|
172
|
+
.bw-demo-barchart > span {
|
|
171
173
|
flex: 1;
|
|
172
174
|
background: var(--bw-color-accent);
|
|
173
175
|
border-radius: 2px 2px 0 0;
|
|
174
176
|
opacity: 0.85;
|
|
175
177
|
}
|
|
176
178
|
|
|
177
|
-
.bw-
|
|
178
|
-
.bw-
|
|
179
|
-
.bw-
|
|
180
|
-
.bw-
|
|
181
|
-
.bw-
|
|
179
|
+
.bw-demo-barchart > span:nth-child(1) { block-size: 35%; }
|
|
180
|
+
.bw-demo-barchart > span:nth-child(2) { block-size: 55%; }
|
|
181
|
+
.bw-demo-barchart > span:nth-child(3) { block-size: 40%; }
|
|
182
|
+
.bw-demo-barchart > span:nth-child(4) { block-size: 75%; }
|
|
183
|
+
.bw-demo-barchart > span:nth-child(5) { block-size: 60%; }
|