@bwui/css 0.1.4 → 0.1.6

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.
@@ -61,12 +61,26 @@
61
61
  --bw-size-control-padding-inline-md: var(--bw-density-control-padding-inline);
62
62
  --bw-size-control-padding-inline-lg: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-lg));
63
63
  --bw-size-control-padding-inline-xl: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-xl));
64
+ --bw-size-control-icon-xs: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-xs));
65
+ --bw-size-control-icon-sm: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-sm));
66
+ --bw-size-control-icon-md: var(--bw-component-icon-size-sm);
67
+ --bw-size-control-icon-lg: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-lg));
68
+ --bw-size-control-icon-xl: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-xl));
69
+ --bw-size-control-gap-xs: var(--bw-space-1-5);
70
+ --bw-size-control-gap-sm: var(--bw-space-2);
71
+ --bw-size-control-gap-md: var(--bw-space-2);
72
+ --bw-size-control-gap-lg: var(--bw-space-3);
73
+ --bw-size-control-gap-xl: var(--bw-space-3);
64
74
  --bw-size-touch-target-min: 2.75rem;
65
75
  --bw-size-max-width-prose: 65ch;
66
76
  --bw-size-max-width-form: 32rem;
67
77
  --bw-size-max-width-modal-sm: 28rem;
68
78
  --bw-size-max-width-modal-md: 32rem;
69
79
  --bw-size-max-width-modal-lg: 48rem;
80
+ --bw-control-height: var(--bw-size-control-height-md);
81
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
82
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
83
+ --bw-control-gap: var(--bw-size-control-gap-md);
70
84
  --bw-component-icon-size-sm: 1rem;
71
85
  --bw-component-icon-size-md: 1.25rem;
72
86
  --bw-component-icon-size-lg: 1.5rem;
@@ -623,6 +637,20 @@
623
637
  --bw-size-control-padding-inline-md: var(--bw-density-control-padding-inline);
624
638
  --bw-size-control-padding-inline-lg: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-lg));
625
639
  --bw-size-control-padding-inline-xl: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-xl));
640
+ --bw-size-control-icon-xs: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-xs));
641
+ --bw-size-control-icon-sm: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-sm));
642
+ --bw-size-control-icon-md: var(--bw-component-icon-size-sm);
643
+ --bw-size-control-icon-lg: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-lg));
644
+ --bw-size-control-icon-xl: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-xl));
645
+ --bw-size-control-gap-xs: var(--bw-space-1-5);
646
+ --bw-size-control-gap-sm: var(--bw-space-2);
647
+ --bw-size-control-gap-md: var(--bw-space-2);
648
+ --bw-size-control-gap-lg: var(--bw-space-3);
649
+ --bw-size-control-gap-xl: var(--bw-space-3);
650
+ --bw-control-height: var(--bw-size-control-height-md);
651
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
652
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
653
+ --bw-control-gap: var(--bw-size-control-gap-md);
626
654
  }
627
655
 
628
656
  [data-density="compact"] {
@@ -649,6 +677,20 @@
649
677
  --bw-size-control-padding-inline-md: var(--bw-density-control-padding-inline);
650
678
  --bw-size-control-padding-inline-lg: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-lg));
651
679
  --bw-size-control-padding-inline-xl: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-xl));
680
+ --bw-size-control-icon-xs: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-xs));
681
+ --bw-size-control-icon-sm: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-sm));
682
+ --bw-size-control-icon-md: var(--bw-component-icon-size-sm);
683
+ --bw-size-control-icon-lg: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-lg));
684
+ --bw-size-control-icon-xl: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-xl));
685
+ --bw-size-control-gap-xs: var(--bw-space-1-5);
686
+ --bw-size-control-gap-sm: var(--bw-space-2);
687
+ --bw-size-control-gap-md: var(--bw-space-2);
688
+ --bw-size-control-gap-lg: var(--bw-space-3);
689
+ --bw-size-control-gap-xl: var(--bw-space-3);
690
+ --bw-control-height: var(--bw-size-control-height-md);
691
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
692
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
693
+ --bw-control-gap: var(--bw-size-control-gap-md);
652
694
  }
653
695
 
654
696
  [data-density="spacious"] {
@@ -675,6 +717,20 @@
675
717
  --bw-size-control-padding-inline-md: var(--bw-density-control-padding-inline);
676
718
  --bw-size-control-padding-inline-lg: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-lg));
677
719
  --bw-size-control-padding-inline-xl: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-xl));
720
+ --bw-size-control-icon-xs: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-xs));
721
+ --bw-size-control-icon-sm: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-sm));
722
+ --bw-size-control-icon-md: var(--bw-component-icon-size-sm);
723
+ --bw-size-control-icon-lg: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-lg));
724
+ --bw-size-control-icon-xl: calc(var(--bw-component-icon-size-sm) * var(--bw-size-step-xl));
725
+ --bw-size-control-gap-xs: var(--bw-space-1-5);
726
+ --bw-size-control-gap-sm: var(--bw-space-2);
727
+ --bw-size-control-gap-md: var(--bw-space-2);
728
+ --bw-size-control-gap-lg: var(--bw-space-3);
729
+ --bw-size-control-gap-xl: var(--bw-space-3);
730
+ --bw-control-height: var(--bw-size-control-height-md);
731
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
732
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
733
+ --bw-control-gap: var(--bw-size-control-gap-md);
678
734
  }
679
735
 
680
736
  :root {
@@ -1125,15 +1181,8 @@ a:hover {
1125
1181
  text-transform: uppercase;
1126
1182
  }
1127
1183
 
1128
- /* Primary CTA alias used in early gallery drafts */
1129
- .bw-btn--solid {
1130
- background-color: var(--bw-color-accent);
1131
- color: var(--bw-color-accent-fg);
1132
- border-color: transparent;
1133
- }
1134
- .bw-btn--solid:hover {
1135
- background-color: var(--bw-color-accent-hover, var(--bw-color-accent));
1136
- }
1184
+ /* .bw-btn--solid (the early-draft name of primary) is a deprecated alias of
1185
+ * .bw-btn--primary and lives with the button rules in layers/components.css. */
1137
1186
 
1138
1187
 
1139
1188
  /* ==== layer: shell ==== */
@@ -3173,16 +3222,32 @@ a:hover {
3173
3222
  * Logical CSS properties throughout (RTL via `dir`). Nothing here needs JS.
3174
3223
  */
3175
3224
 
3176
- /* --- Buttons --------------------------------------------------------------- */
3225
+ /* --- Buttons (docs/components/button.md) ----------------------------------- */
3226
+
3227
+ /* Operable guard. A state rule (hover, press) applies only to a control that is
3228
+ * operable and not busy: not the .bw-btn--disabled class (the non-button
3229
+ * elements), not :disabled (a real <button>), not aria-disabled, not
3230
+ * aria-busy. :not() takes the specificity of its most specific argument, so
3231
+ * the guard weighs the same as the single :not(.bw-btn--disabled) it replaces
3232
+ * and no existing cascade relationship moves. The resting shadow rules use a
3233
+ * narrower guard (not disabled, but a busy control keeps its resting shadow).
3234
+ * Before this guard a disabled or loading <button> still took the hover fill,
3235
+ * ring and (for ghost) the full ink: .bw-btn:disabled weighs 0,2,0 and the
3236
+ * hover rules weighed 0,3,0 (GAP-BTN-1). */
3177
3237
 
3178
3238
  .bw-btn {
3179
3239
  display: inline-flex;
3180
3240
  align-items: center;
3181
3241
  justify-content: center;
3182
- gap: var(--bw-space-2);
3242
+ /* ADR-126 section 4: the button reads only the four control role variables.
3243
+ * They are declared on :root and in every [data-density] block (md at the
3244
+ * density in force) and are inherited here, so a bare .bw-btn is md, a size
3245
+ * class re-points them, and a control container can set one step for its
3246
+ * children. The button never reads a density or step token itself. */
3247
+ gap: var(--bw-control-gap);
3183
3248
  padding-block: 0;
3184
- padding-inline: var(--bw-density-control-padding-inline);
3185
- block-size: var(--bw-density-control-height);
3249
+ padding-inline: var(--bw-control-padding-inline);
3250
+ block-size: var(--bw-control-height);
3186
3251
  border: var(--bw-size-border-hairline) solid transparent;
3187
3252
  border-radius: var(--bw-component-button-radius);
3188
3253
  font: inherit;
@@ -3191,6 +3256,9 @@ a:hover {
3191
3256
  font-weight: var(--bw-text-label-weight);
3192
3257
  line-height: var(--bw-text-label-line-height);
3193
3258
  letter-spacing: var(--bw-text-label-tracking);
3259
+ /* One line, always (BTN-014): the block size is fixed, so a wrapped label
3260
+ * would spill out of the control (GAP-BTN-4). */
3261
+ white-space: nowrap;
3194
3262
  cursor: pointer;
3195
3263
  text-decoration: none;
3196
3264
  transition:
@@ -3198,46 +3266,83 @@ a:hover {
3198
3266
  var(--bw-transition-shadow),
3199
3267
  var(--bw-transition-transform);
3200
3268
  }
3201
- /* Size classes (ADR-125 section 6): the grammar is bw-<component>--size-<step>.
3269
+ /* The reset underlines every a:hover (0,1,1), which outweighs the 0,1,0 above,
3270
+ * so a link-button underlined on hover (GAP-BTN-2). */
3271
+ .bw-btn:hover {
3272
+ text-decoration: none;
3273
+ }
3274
+ /* Size classes (ADR-125 section 6, ADR-126 section 4): the grammar is
3275
+ * bw-<component>--size-<step>, and a size class only re-points the four control
3276
+ * role variables at the resolved step tokens. The step tokens are the density
3277
+ * control base times the kit-wide multiplier (--bw-size-step-*), so every
3278
+ * density keeps three distinct heights; no rule here computes a multiplier.
3279
+ * xs and xl exist in the token scale and Button does not ship them (BTN-003).
3280
+ *
3202
3281
  * The bare spelling (bw-btn--sm, and the same for gauge, icon, modal,
3203
3282
  * slide-over, stat and stat-comparison) is DEPRECATED. Both selectors stay in
3204
3283
  * one grouped rule for the deprecation window; the bare ones are removed in
3205
3284
  * the next major of django-brickwork and in the @bwui/css release shipped with
3206
- * it. Templates, React, Vue and the gallery emit the new class. */
3285
+ * it. Templates, React, Vue and the gallery emit the new class.
3286
+ *
3287
+ * md has its own rule (icvoss/django-brickwork#130) so the class that markup
3288
+ * emits is named in the stylesheet, and so a button that names md keeps md
3289
+ * inside a container that scoped a different step. */
3207
3290
  .bw-btn--sm, .bw-btn--size-sm {
3208
- block-size: var(--bw-size-control-height-sm);
3209
- padding-inline: var(--bw-size-control-padding-inline-sm);
3210
- }
3211
- /* md is the base .bw-btn size (icvoss/django-brickwork#130): every shipped
3212
- * template that names a size emits bw-btn--md explicitly rather than leaving
3213
- * it implicit, so the class needs its own rule even though it restates the
3214
- * base values, exactly as .bw-btn--sm and .bw-btn--lg restate theirs relative
3215
- * to the base. Without this rule the class existed in markup with nothing in
3216
- * the stylesheet naming it, which is the defect class this issue is about:
3217
- * the base values happened to make it look correct by accident. */
3291
+ --bw-control-height: var(--bw-size-control-height-sm);
3292
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
3293
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
3294
+ --bw-control-gap: var(--bw-size-control-gap-sm);
3295
+ }
3218
3296
  .bw-btn--md, .bw-btn--size-md {
3219
- block-size: var(--bw-size-control-height-md);
3220
- padding-inline: var(--bw-size-control-padding-inline-md);
3297
+ --bw-control-height: var(--bw-size-control-height-md);
3298
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
3299
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
3300
+ --bw-control-gap: var(--bw-size-control-gap-md);
3221
3301
  }
3222
- /* ADR-125: sm, md and lg resolve from the density control base times a
3223
- * kit-wide step multiplier (--bw-size-step-*), not from absolute rem values,
3224
- * so every density keeps three distinct heights. */
3225
3302
  .bw-btn--lg, .bw-btn--size-lg {
3226
- block-size: var(--bw-size-control-height-lg);
3227
- padding-inline: var(--bw-size-control-padding-inline-lg);
3303
+ --bw-control-height: var(--bw-size-control-height-lg);
3304
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
3305
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
3306
+ --bw-control-gap: var(--bw-size-control-gap-lg);
3307
+ }
3308
+ /* The glyph and the label are one line of content. The icon is a bw-icon, and
3309
+ * a bare .bw-icon (wave-e) paints a raised box and a muted ink, which showed
3310
+ * as a white square and a grey glyph on a primary button (GAP-BTN-3). Inside
3311
+ * a button the icon is a plain glyph in the button's own ink. Two classes
3312
+ * outrank .bw-icon whatever the layer order. */
3313
+ .bw-btn .bw-btn__icon {
3314
+ background: transparent;
3315
+ border-radius: 0;
3316
+ color: inherit;
3317
+ }
3318
+ /* The glyph and the busy spinner follow the control's step through the role
3319
+ * variable (ADR-125 section 5: an icon inside a control follows its step). The
3320
+ * box is set directly, not through --bw-icon-size, because {% bw_icon %} writes
3321
+ * that custom property inline and an inline declaration would outrank this
3322
+ * rule. Markup in a button carries no inline size. */
3323
+ .bw-btn .bw-btn__icon,
3324
+ .bw-btn .bw-spinner {
3325
+ inline-size: var(--bw-control-icon-size);
3326
+ block-size: var(--bw-control-icon-size);
3228
3327
  }
3229
3328
  /* Solid buttons carry a border in their own hue (0.7.0 craft): 80% of the fill
3230
3329
  * toward black is the Radix solid-button edge, a shade the fill visibly sits
3231
3330
  * inside (decorative against the fill at 1.59:1 light / 1.73:1 dark; it also
3232
3331
  * defines the button against the surface at 8.10:1 / 4.12:1 for primary and
3233
3332
  * 7.74:1 / 3.00:1 for danger). The edge deliberately outlives hover: the
3234
- * hover fill (89% toward black) stays lighter than the 80% edge. */
3235
- .bw-btn--primary {
3333
+ * hover fill (89% toward black) stays lighter than the 80% edge.
3334
+ *
3335
+ * .bw-btn--solid is the early-draft name of primary. It is DEPRECATED, kept
3336
+ * here as an alias through :is() (class weight) for the window ADR-125 sets
3337
+ * for the bare size classes, and removed with them. Its old standalone rule
3338
+ * read --bw-color-accent-fg, which is not a token, so it needed a per-page
3339
+ * shim (GAP-BTN-6). */
3340
+ :is(.bw-btn--primary, .bw-btn--solid) {
3236
3341
  background: var(--bw-color-accent);
3237
3342
  color: var(--bw-color-fg-on-accent);
3238
3343
  border-color: color-mix(in oklab, var(--bw-color-accent) 80%, black);
3239
3344
  }
3240
- .bw-btn--primary:not(.bw-btn--disabled):hover {
3345
+ :is(.bw-btn--primary, .bw-btn--solid):not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
3241
3346
  background: var(--bw-color-accent-hover);
3242
3347
  box-shadow: var(--bw-component-button-elevation-hover), inset 0 1px 0 0 oklch(1 0 0 / 0.12);
3243
3348
  transform: translateY(var(--bw-component-button-hover-translate));
@@ -3251,10 +3356,10 @@ a:hover {
3251
3356
  color: var(--bw-color-fg);
3252
3357
  border-color: var(--bw-color-border);
3253
3358
  }
3254
- .bw-btn--secondary:not(.bw-btn--disabled) {
3359
+ .bw-btn--secondary:not(.bw-btn--disabled, :disabled:not([aria-busy="true"]), [aria-disabled="true"]:not([aria-busy="true"])) {
3255
3360
  box-shadow: var(--bw-component-button-elevation);
3256
3361
  }
3257
- .bw-btn--secondary:not(.bw-btn--disabled):hover {
3362
+ .bw-btn--secondary:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
3258
3363
  border-color: var(--bw-color-border-strong);
3259
3364
  background-color: var(--bw-color-surface-sunken);
3260
3365
  box-shadow: var(--bw-component-button-elevation-hover);
@@ -3266,7 +3371,7 @@ a:hover {
3266
3371
  * weight; steps up to full fg on hover. */
3267
3372
  color: var(--bw-color-fg-muted);
3268
3373
  }
3269
- .bw-btn--ghost:not(.bw-btn--disabled):hover {
3374
+ .bw-btn--ghost:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
3270
3375
  background-color: var(--bw-state-hover-overlay);
3271
3376
  color: var(--bw-color-fg);
3272
3377
  }
@@ -3276,7 +3381,7 @@ a:hover {
3276
3381
  /* Same 80%-toward-black edge as primary, in the danger hue (ratios above). */
3277
3382
  border-color: color-mix(in oklab, var(--bw-color-danger) 80%, black);
3278
3383
  }
3279
- .bw-btn--danger:not(.bw-btn--disabled):hover {
3384
+ .bw-btn--danger:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
3280
3385
  background-image: linear-gradient(var(--bw-state-hover-overlay), var(--bw-state-hover-overlay));
3281
3386
  box-shadow: var(--bw-component-button-elevation-hover), inset 0 1px 0 0 oklch(1 0 0 / 0.12);
3282
3387
  transform: translateY(var(--bw-component-button-hover-translate));
@@ -3284,12 +3389,12 @@ a:hover {
3284
3389
  /* Filled action buttons carry physical weight: resting elevation plus a faint
3285
3390
  * top bevel; pressing swaps to an inset shadow so the button visibly sinks.
3286
3391
  * Elevation is the per-button token (#649); the inset highlight is craft. */
3287
- .bw-btn--primary:not(.bw-btn--disabled),
3288
- .bw-btn--danger:not(.bw-btn--disabled) {
3392
+ :is(.bw-btn--primary, .bw-btn--solid):not(.bw-btn--disabled, :disabled:not([aria-busy="true"]), [aria-disabled="true"]:not([aria-busy="true"])),
3393
+ .bw-btn--danger:not(.bw-btn--disabled, :disabled:not([aria-busy="true"]), [aria-disabled="true"]:not([aria-busy="true"])) {
3289
3394
  box-shadow: var(--bw-component-button-elevation), inset 0 1px 0 0 oklch(1 0 0 / 0.12);
3290
3395
  }
3291
- .bw-btn--primary:not(.bw-btn--disabled):active,
3292
- .bw-btn--danger:not(.bw-btn--disabled):active {
3396
+ :is(.bw-btn--primary, .bw-btn--solid):not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):active,
3397
+ .bw-btn--danger:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):active {
3293
3398
  box-shadow: inset 0 1px 2px 0 oklch(0 0 0 / 0.2);
3294
3399
  transform: none;
3295
3400
  }
@@ -3298,12 +3403,12 @@ a:hover {
3298
3403
  * hovers so it wins the background-image cascade; instant so the press reads
3299
3404
  * immediately. Ghost is excluded (its states are solid overlay fills, so a
3300
3405
  * stacked image would double the tint) and gets its own solid active fill. */
3301
- .bw-btn:not(.bw-btn--disabled):not(.bw-btn--ghost):active {
3406
+ .bw-btn:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):not(.bw-btn--ghost):active {
3302
3407
  background-image: linear-gradient(var(--bw-state-active-overlay), var(--bw-state-active-overlay));
3303
3408
  transition-duration: var(--bw-duration-instant);
3304
3409
  transform: none;
3305
3410
  }
3306
- .bw-btn--ghost:not(.bw-btn--disabled):active {
3411
+ .bw-btn--ghost:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):active {
3307
3412
  background-color: var(--bw-state-active-overlay);
3308
3413
  background-image: none;
3309
3414
  transition-duration: var(--bw-duration-instant);
@@ -3311,28 +3416,36 @@ a:hover {
3311
3416
  /* Hover-lift is opt-in via --bw-component-button-hover-translate (#649).
3312
3417
  * Prefer no transform when the user asks for reduced motion. */
3313
3418
  @media (prefers-reduced-motion: reduce) {
3314
- .bw-btn--primary:not(.bw-btn--disabled):hover,
3315
- .bw-btn--secondary:not(.bw-btn--disabled):hover,
3316
- .bw-btn--danger:not(.bw-btn--disabled):hover {
3419
+ :is(.bw-btn--primary, .bw-btn--solid):not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover,
3420
+ .bw-btn--secondary:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover,
3421
+ .bw-btn--danger:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
3317
3422
  transform: none;
3318
3423
  }
3319
3424
  }
3320
3425
  .bw-btn--icon-only {
3321
- inline-size: var(--bw-density-control-height);
3426
+ inline-size: var(--bw-control-height);
3322
3427
  padding-inline: 0;
3323
3428
  }
3324
- /* Exact square at every size (0.7.0 craft): the sm/lg heights bring their own
3325
- * widths, so an icon button's optical padding is identical on all four sides. */
3326
- .bw-btn--sm.bw-btn--icon-only, .bw-btn--size-sm.bw-btn--icon-only {
3327
- inline-size: var(--bw-size-control-height-sm);
3328
- }
3329
- .bw-btn--lg.bw-btn--icon-only, .bw-btn--size-lg.bw-btn--icon-only {
3330
- inline-size: var(--bw-size-control-height-lg);
3429
+ /* Exact square at every size (0.7.0 craft): the role variable carries the
3430
+ * step's height, so the optical padding is identical on all four sides with no
3431
+ * per-size rule. */
3432
+ /* fit (ADR-126 section 3): auto is the default and emits no class; fill takes
3433
+ * the width of its container. After the icon-only rule so the two never fight.
3434
+ * Django and React reject fit="fill" with icon_only: an icon-only control is a
3435
+ * square, so fill would be a silent no-op (ADR-060 section 3). */
3436
+ .bw-btn--fit-fill {
3437
+ inline-size: 100%;
3331
3438
  }
3332
3439
  /* Flat disabled colours (COL-018 / #282), not opacity: opacity failed
3333
- * contrast on most surfaces and cannot be gated under brand overrides. */
3334
- .bw-btn:disabled,
3335
- .bw-btn--disabled {
3440
+ * contrast on most surfaces and cannot be gated under brand overrides. Three
3441
+ * spellings, one look: the disabled attribute (a <button>), the class (the
3442
+ * non-navigable <span> a disabled link-button renders as) and aria-disabled
3443
+ * (any other host). A busy control is not flat: it holds its variant colours
3444
+ * (BTN-031) and is told apart by the spinner, the not-operable cursor and
3445
+ * aria-busy, so a loading primary does not flash grey. */
3446
+ .bw-btn:disabled:not([aria-busy="true"]),
3447
+ .bw-btn--disabled:not([aria-busy="true"]),
3448
+ .bw-btn[aria-disabled="true"]:not([aria-busy="true"]) {
3336
3449
  background: var(--bw-color-action-disabled-bg);
3337
3450
  background-image: none;
3338
3451
  color: var(--bw-color-action-disabled-text);
@@ -3340,6 +3453,9 @@ a:hover {
3340
3453
  box-shadow: none;
3341
3454
  cursor: not-allowed;
3342
3455
  }
3456
+ .bw-btn[aria-busy="true"] {
3457
+ cursor: progress;
3458
+ }
3343
3459
 
3344
3460
  .bw-spinner {
3345
3461
  /* Sized via --bw-icon-size (set inline to a size token), the same mechanism
@@ -3510,6 +3626,10 @@ a:hover {
3510
3626
  }
3511
3627
  .bw-form__actions {
3512
3628
  display: flex;
3629
+ /* .bw-btn is white-space: nowrap (0.1.5, "a label stays on one line"), so a
3630
+ * row of buttons cannot shrink; it wraps onto further lines instead of
3631
+ * widening the document at narrow widths (icvoss/brickwork#52). */
3632
+ flex-wrap: wrap;
3513
3633
  align-items: center;
3514
3634
  gap: var(--bw-space-3);
3515
3635
  margin-block-start: var(--bw-space-2);
@@ -4861,6 +4981,7 @@ button.bw-account-menu__item {
4861
4981
  }
4862
4982
  .bw-filter-bar__actions {
4863
4983
  display: flex;
4984
+ flex-wrap: wrap;
4864
4985
  align-items: center;
4865
4986
  gap: var(--bw-space-2);
4866
4987
  }
@@ -6881,6 +7002,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
6881
7002
  * render nothing at the template, so no :empty rule is needed. */
6882
7003
  .bw-modal__footer {
6883
7004
  display: flex;
7005
+ flex-wrap: wrap;
6884
7006
  align-items: center;
6885
7007
  justify-content: flex-end;
6886
7008
  gap: var(--bw-space-3);
@@ -7091,6 +7213,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
7091
7213
  }
7092
7214
  .bw-slide-over__footer {
7093
7215
  display: flex;
7216
+ flex-wrap: wrap;
7094
7217
  align-items: center;
7095
7218
  justify-content: flex-end;
7096
7219
  gap: var(--bw-space-3);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bwui/css",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
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",
@@ -21,7 +21,7 @@
21
21
  "./src/*": "./src/*"
22
22
  },
23
23
  "dependencies": {
24
- "@bwui/tokens": "0.1.4"
24
+ "@bwui/tokens": "0.1.6"
25
25
  },
26
26
  "devDependencies": {
27
27
  "tsx": "^4.19.2"
@@ -2,16 +2,32 @@
2
2
  * Logical CSS properties throughout (RTL via `dir`). Nothing here needs JS.
3
3
  */
4
4
 
5
- /* --- Buttons --------------------------------------------------------------- */
5
+ /* --- Buttons (docs/components/button.md) ----------------------------------- */
6
+
7
+ /* Operable guard. A state rule (hover, press) applies only to a control that is
8
+ * operable and not busy: not the .bw-btn--disabled class (the non-button
9
+ * elements), not :disabled (a real <button>), not aria-disabled, not
10
+ * aria-busy. :not() takes the specificity of its most specific argument, so
11
+ * the guard weighs the same as the single :not(.bw-btn--disabled) it replaces
12
+ * and no existing cascade relationship moves. The resting shadow rules use a
13
+ * narrower guard (not disabled, but a busy control keeps its resting shadow).
14
+ * Before this guard a disabled or loading <button> still took the hover fill,
15
+ * ring and (for ghost) the full ink: .bw-btn:disabled weighs 0,2,0 and the
16
+ * hover rules weighed 0,3,0 (GAP-BTN-1). */
6
17
 
7
18
  .bw-btn {
8
19
  display: inline-flex;
9
20
  align-items: center;
10
21
  justify-content: center;
11
- gap: var(--bw-space-2);
22
+ /* ADR-126 section 4: the button reads only the four control role variables.
23
+ * They are declared on :root and in every [data-density] block (md at the
24
+ * density in force) and are inherited here, so a bare .bw-btn is md, a size
25
+ * class re-points them, and a control container can set one step for its
26
+ * children. The button never reads a density or step token itself. */
27
+ gap: var(--bw-control-gap);
12
28
  padding-block: 0;
13
- padding-inline: var(--bw-density-control-padding-inline);
14
- block-size: var(--bw-density-control-height);
29
+ padding-inline: var(--bw-control-padding-inline);
30
+ block-size: var(--bw-control-height);
15
31
  border: var(--bw-size-border-hairline) solid transparent;
16
32
  border-radius: var(--bw-component-button-radius);
17
33
  font: inherit;
@@ -20,6 +36,9 @@
20
36
  font-weight: var(--bw-text-label-weight);
21
37
  line-height: var(--bw-text-label-line-height);
22
38
  letter-spacing: var(--bw-text-label-tracking);
39
+ /* One line, always (BTN-014): the block size is fixed, so a wrapped label
40
+ * would spill out of the control (GAP-BTN-4). */
41
+ white-space: nowrap;
23
42
  cursor: pointer;
24
43
  text-decoration: none;
25
44
  transition:
@@ -27,46 +46,83 @@
27
46
  var(--bw-transition-shadow),
28
47
  var(--bw-transition-transform);
29
48
  }
30
- /* Size classes (ADR-125 section 6): the grammar is bw-<component>--size-<step>.
49
+ /* The reset underlines every a:hover (0,1,1), which outweighs the 0,1,0 above,
50
+ * so a link-button underlined on hover (GAP-BTN-2). */
51
+ .bw-btn:hover {
52
+ text-decoration: none;
53
+ }
54
+ /* Size classes (ADR-125 section 6, ADR-126 section 4): the grammar is
55
+ * bw-<component>--size-<step>, and a size class only re-points the four control
56
+ * role variables at the resolved step tokens. The step tokens are the density
57
+ * control base times the kit-wide multiplier (--bw-size-step-*), so every
58
+ * density keeps three distinct heights; no rule here computes a multiplier.
59
+ * xs and xl exist in the token scale and Button does not ship them (BTN-003).
60
+ *
31
61
  * The bare spelling (bw-btn--sm, and the same for gauge, icon, modal,
32
62
  * slide-over, stat and stat-comparison) is DEPRECATED. Both selectors stay in
33
63
  * one grouped rule for the deprecation window; the bare ones are removed in
34
64
  * the next major of django-brickwork and in the @bwui/css release shipped with
35
- * it. Templates, React, Vue and the gallery emit the new class. */
65
+ * it. Templates, React, Vue and the gallery emit the new class.
66
+ *
67
+ * md has its own rule (icvoss/django-brickwork#130) so the class that markup
68
+ * emits is named in the stylesheet, and so a button that names md keeps md
69
+ * inside a container that scoped a different step. */
36
70
  .bw-btn--sm, .bw-btn--size-sm {
37
- block-size: var(--bw-size-control-height-sm);
38
- padding-inline: var(--bw-size-control-padding-inline-sm);
39
- }
40
- /* md is the base .bw-btn size (icvoss/django-brickwork#130): every shipped
41
- * template that names a size emits bw-btn--md explicitly rather than leaving
42
- * it implicit, so the class needs its own rule even though it restates the
43
- * base values, exactly as .bw-btn--sm and .bw-btn--lg restate theirs relative
44
- * to the base. Without this rule the class existed in markup with nothing in
45
- * the stylesheet naming it, which is the defect class this issue is about:
46
- * the base values happened to make it look correct by accident. */
71
+ --bw-control-height: var(--bw-size-control-height-sm);
72
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
73
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
74
+ --bw-control-gap: var(--bw-size-control-gap-sm);
75
+ }
47
76
  .bw-btn--md, .bw-btn--size-md {
48
- block-size: var(--bw-size-control-height-md);
49
- padding-inline: var(--bw-size-control-padding-inline-md);
77
+ --bw-control-height: var(--bw-size-control-height-md);
78
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
79
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
80
+ --bw-control-gap: var(--bw-size-control-gap-md);
50
81
  }
51
- /* ADR-125: sm, md and lg resolve from the density control base times a
52
- * kit-wide step multiplier (--bw-size-step-*), not from absolute rem values,
53
- * so every density keeps three distinct heights. */
54
82
  .bw-btn--lg, .bw-btn--size-lg {
55
- block-size: var(--bw-size-control-height-lg);
56
- padding-inline: var(--bw-size-control-padding-inline-lg);
83
+ --bw-control-height: var(--bw-size-control-height-lg);
84
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
85
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
86
+ --bw-control-gap: var(--bw-size-control-gap-lg);
87
+ }
88
+ /* The glyph and the label are one line of content. The icon is a bw-icon, and
89
+ * a bare .bw-icon (wave-e) paints a raised box and a muted ink, which showed
90
+ * as a white square and a grey glyph on a primary button (GAP-BTN-3). Inside
91
+ * a button the icon is a plain glyph in the button's own ink. Two classes
92
+ * outrank .bw-icon whatever the layer order. */
93
+ .bw-btn .bw-btn__icon {
94
+ background: transparent;
95
+ border-radius: 0;
96
+ color: inherit;
97
+ }
98
+ /* The glyph and the busy spinner follow the control's step through the role
99
+ * variable (ADR-125 section 5: an icon inside a control follows its step). The
100
+ * box is set directly, not through --bw-icon-size, because {% bw_icon %} writes
101
+ * that custom property inline and an inline declaration would outrank this
102
+ * rule. Markup in a button carries no inline size. */
103
+ .bw-btn .bw-btn__icon,
104
+ .bw-btn .bw-spinner {
105
+ inline-size: var(--bw-control-icon-size);
106
+ block-size: var(--bw-control-icon-size);
57
107
  }
58
108
  /* Solid buttons carry a border in their own hue (0.7.0 craft): 80% of the fill
59
109
  * toward black is the Radix solid-button edge, a shade the fill visibly sits
60
110
  * inside (decorative against the fill at 1.59:1 light / 1.73:1 dark; it also
61
111
  * defines the button against the surface at 8.10:1 / 4.12:1 for primary and
62
112
  * 7.74:1 / 3.00:1 for danger). The edge deliberately outlives hover: the
63
- * hover fill (89% toward black) stays lighter than the 80% edge. */
64
- .bw-btn--primary {
113
+ * hover fill (89% toward black) stays lighter than the 80% edge.
114
+ *
115
+ * .bw-btn--solid is the early-draft name of primary. It is DEPRECATED, kept
116
+ * here as an alias through :is() (class weight) for the window ADR-125 sets
117
+ * for the bare size classes, and removed with them. Its old standalone rule
118
+ * read --bw-color-accent-fg, which is not a token, so it needed a per-page
119
+ * shim (GAP-BTN-6). */
120
+ :is(.bw-btn--primary, .bw-btn--solid) {
65
121
  background: var(--bw-color-accent);
66
122
  color: var(--bw-color-fg-on-accent);
67
123
  border-color: color-mix(in oklab, var(--bw-color-accent) 80%, black);
68
124
  }
69
- .bw-btn--primary:not(.bw-btn--disabled):hover {
125
+ :is(.bw-btn--primary, .bw-btn--solid):not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
70
126
  background: var(--bw-color-accent-hover);
71
127
  box-shadow: var(--bw-component-button-elevation-hover), inset 0 1px 0 0 oklch(1 0 0 / 0.12);
72
128
  transform: translateY(var(--bw-component-button-hover-translate));
@@ -80,10 +136,10 @@
80
136
  color: var(--bw-color-fg);
81
137
  border-color: var(--bw-color-border);
82
138
  }
83
- .bw-btn--secondary:not(.bw-btn--disabled) {
139
+ .bw-btn--secondary:not(.bw-btn--disabled, :disabled:not([aria-busy="true"]), [aria-disabled="true"]:not([aria-busy="true"])) {
84
140
  box-shadow: var(--bw-component-button-elevation);
85
141
  }
86
- .bw-btn--secondary:not(.bw-btn--disabled):hover {
142
+ .bw-btn--secondary:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
87
143
  border-color: var(--bw-color-border-strong);
88
144
  background-color: var(--bw-color-surface-sunken);
89
145
  box-shadow: var(--bw-component-button-elevation-hover);
@@ -95,7 +151,7 @@
95
151
  * weight; steps up to full fg on hover. */
96
152
  color: var(--bw-color-fg-muted);
97
153
  }
98
- .bw-btn--ghost:not(.bw-btn--disabled):hover {
154
+ .bw-btn--ghost:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
99
155
  background-color: var(--bw-state-hover-overlay);
100
156
  color: var(--bw-color-fg);
101
157
  }
@@ -105,7 +161,7 @@
105
161
  /* Same 80%-toward-black edge as primary, in the danger hue (ratios above). */
106
162
  border-color: color-mix(in oklab, var(--bw-color-danger) 80%, black);
107
163
  }
108
- .bw-btn--danger:not(.bw-btn--disabled):hover {
164
+ .bw-btn--danger:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
109
165
  background-image: linear-gradient(var(--bw-state-hover-overlay), var(--bw-state-hover-overlay));
110
166
  box-shadow: var(--bw-component-button-elevation-hover), inset 0 1px 0 0 oklch(1 0 0 / 0.12);
111
167
  transform: translateY(var(--bw-component-button-hover-translate));
@@ -113,12 +169,12 @@
113
169
  /* Filled action buttons carry physical weight: resting elevation plus a faint
114
170
  * top bevel; pressing swaps to an inset shadow so the button visibly sinks.
115
171
  * Elevation is the per-button token (#649); the inset highlight is craft. */
116
- .bw-btn--primary:not(.bw-btn--disabled),
117
- .bw-btn--danger:not(.bw-btn--disabled) {
172
+ :is(.bw-btn--primary, .bw-btn--solid):not(.bw-btn--disabled, :disabled:not([aria-busy="true"]), [aria-disabled="true"]:not([aria-busy="true"])),
173
+ .bw-btn--danger:not(.bw-btn--disabled, :disabled:not([aria-busy="true"]), [aria-disabled="true"]:not([aria-busy="true"])) {
118
174
  box-shadow: var(--bw-component-button-elevation), inset 0 1px 0 0 oklch(1 0 0 / 0.12);
119
175
  }
120
- .bw-btn--primary:not(.bw-btn--disabled):active,
121
- .bw-btn--danger:not(.bw-btn--disabled):active {
176
+ :is(.bw-btn--primary, .bw-btn--solid):not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):active,
177
+ .bw-btn--danger:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):active {
122
178
  box-shadow: inset 0 1px 2px 0 oklch(0 0 0 / 0.2);
123
179
  transform: none;
124
180
  }
@@ -127,12 +183,12 @@
127
183
  * hovers so it wins the background-image cascade; instant so the press reads
128
184
  * immediately. Ghost is excluded (its states are solid overlay fills, so a
129
185
  * stacked image would double the tint) and gets its own solid active fill. */
130
- .bw-btn:not(.bw-btn--disabled):not(.bw-btn--ghost):active {
186
+ .bw-btn:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):not(.bw-btn--ghost):active {
131
187
  background-image: linear-gradient(var(--bw-state-active-overlay), var(--bw-state-active-overlay));
132
188
  transition-duration: var(--bw-duration-instant);
133
189
  transform: none;
134
190
  }
135
- .bw-btn--ghost:not(.bw-btn--disabled):active {
191
+ .bw-btn--ghost:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):active {
136
192
  background-color: var(--bw-state-active-overlay);
137
193
  background-image: none;
138
194
  transition-duration: var(--bw-duration-instant);
@@ -140,28 +196,36 @@
140
196
  /* Hover-lift is opt-in via --bw-component-button-hover-translate (#649).
141
197
  * Prefer no transform when the user asks for reduced motion. */
142
198
  @media (prefers-reduced-motion: reduce) {
143
- .bw-btn--primary:not(.bw-btn--disabled):hover,
144
- .bw-btn--secondary:not(.bw-btn--disabled):hover,
145
- .bw-btn--danger:not(.bw-btn--disabled):hover {
199
+ :is(.bw-btn--primary, .bw-btn--solid):not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover,
200
+ .bw-btn--secondary:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover,
201
+ .bw-btn--danger:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
146
202
  transform: none;
147
203
  }
148
204
  }
149
205
  .bw-btn--icon-only {
150
- inline-size: var(--bw-density-control-height);
206
+ inline-size: var(--bw-control-height);
151
207
  padding-inline: 0;
152
208
  }
153
- /* Exact square at every size (0.7.0 craft): the sm/lg heights bring their own
154
- * widths, so an icon button's optical padding is identical on all four sides. */
155
- .bw-btn--sm.bw-btn--icon-only, .bw-btn--size-sm.bw-btn--icon-only {
156
- inline-size: var(--bw-size-control-height-sm);
157
- }
158
- .bw-btn--lg.bw-btn--icon-only, .bw-btn--size-lg.bw-btn--icon-only {
159
- inline-size: var(--bw-size-control-height-lg);
209
+ /* Exact square at every size (0.7.0 craft): the role variable carries the
210
+ * step's height, so the optical padding is identical on all four sides with no
211
+ * per-size rule. */
212
+ /* fit (ADR-126 section 3): auto is the default and emits no class; fill takes
213
+ * the width of its container. After the icon-only rule so the two never fight.
214
+ * Django and React reject fit="fill" with icon_only: an icon-only control is a
215
+ * square, so fill would be a silent no-op (ADR-060 section 3). */
216
+ .bw-btn--fit-fill {
217
+ inline-size: 100%;
160
218
  }
161
219
  /* Flat disabled colours (COL-018 / #282), not opacity: opacity failed
162
- * contrast on most surfaces and cannot be gated under brand overrides. */
163
- .bw-btn:disabled,
164
- .bw-btn--disabled {
220
+ * contrast on most surfaces and cannot be gated under brand overrides. Three
221
+ * spellings, one look: the disabled attribute (a <button>), the class (the
222
+ * non-navigable <span> a disabled link-button renders as) and aria-disabled
223
+ * (any other host). A busy control is not flat: it holds its variant colours
224
+ * (BTN-031) and is told apart by the spinner, the not-operable cursor and
225
+ * aria-busy, so a loading primary does not flash grey. */
226
+ .bw-btn:disabled:not([aria-busy="true"]),
227
+ .bw-btn--disabled:not([aria-busy="true"]),
228
+ .bw-btn[aria-disabled="true"]:not([aria-busy="true"]) {
165
229
  background: var(--bw-color-action-disabled-bg);
166
230
  background-image: none;
167
231
  color: var(--bw-color-action-disabled-text);
@@ -169,6 +233,9 @@
169
233
  box-shadow: none;
170
234
  cursor: not-allowed;
171
235
  }
236
+ .bw-btn[aria-busy="true"] {
237
+ cursor: progress;
238
+ }
172
239
 
173
240
  .bw-spinner {
174
241
  /* Sized via --bw-icon-size (set inline to a size token), the same mechanism
@@ -339,6 +406,10 @@
339
406
  }
340
407
  .bw-form__actions {
341
408
  display: flex;
409
+ /* .bw-btn is white-space: nowrap (0.1.5, "a label stays on one line"), so a
410
+ * row of buttons cannot shrink; it wraps onto further lines instead of
411
+ * widening the document at narrow widths (icvoss/brickwork#52). */
412
+ flex-wrap: wrap;
342
413
  align-items: center;
343
414
  gap: var(--bw-space-3);
344
415
  margin-block-start: var(--bw-space-2);
@@ -1690,6 +1761,7 @@ button.bw-account-menu__item {
1690
1761
  }
1691
1762
  .bw-filter-bar__actions {
1692
1763
  display: flex;
1764
+ flex-wrap: wrap;
1693
1765
  align-items: center;
1694
1766
  gap: var(--bw-space-2);
1695
1767
  }
@@ -3710,6 +3782,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3710
3782
  * render nothing at the template, so no :empty rule is needed. */
3711
3783
  .bw-modal__footer {
3712
3784
  display: flex;
3785
+ flex-wrap: wrap;
3713
3786
  align-items: center;
3714
3787
  justify-content: flex-end;
3715
3788
  gap: var(--bw-space-3);
@@ -3920,6 +3993,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3920
3993
  }
3921
3994
  .bw-slide-over__footer {
3922
3995
  display: flex;
3996
+ flex-wrap: wrap;
3923
3997
  align-items: center;
3924
3998
  justify-content: flex-end;
3925
3999
  gap: var(--bw-space-3);
package/src/layout.css CHANGED
@@ -108,12 +108,5 @@
108
108
  text-transform: uppercase;
109
109
  }
110
110
 
111
- /* Primary CTA alias used in early gallery drafts */
112
- .bw-btn--solid {
113
- background-color: var(--bw-color-accent);
114
- color: var(--bw-color-accent-fg);
115
- border-color: transparent;
116
- }
117
- .bw-btn--solid:hover {
118
- background-color: var(--bw-color-accent-hover, var(--bw-color-accent));
119
- }
111
+ /* .bw-btn--solid (the early-draft name of primary) is a deprecated alias of
112
+ * .bw-btn--primary and lives with the button rules in layers/components.css. */