Skip to content

Commit 34bdff5

Browse files
feat(tokens, css): DLT-3331 rename success tokens and utility classes to positive (#1230)
1 parent 1328452 commit 34bdff5

30 files changed

Lines changed: 333 additions & 109 deletions

File tree

.claude/rules/css-specificity.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@ Every component selector should aim for a specificity of (0,1,0) — one class.
1212
```less
1313
.d-banner {} // (0,1,0) — block
1414
.d-banner__dialog {} // (0,1,0) — element
15-
.d-banner--success {} // (0,1,0) — modifier
15+
.d-banner--positive {} // (0,1,0) — modifier
1616
```
1717

1818
Modifier overrides should use CSS custom properties, not higher specificity:
1919

2020
```less
2121
// CORRECT — modifier overrides a variable, same specificity
2222
.d-banner { --banner-color: var(--dt-color-surface-primary); }
23-
.d-banner--success { --banner-color: var(--dt-color-surface-success); }
23+
.d-banner--positive { --banner-color: var(--dt-color-surface-positive); }
2424

2525
// AVOID — parent modifier targets child, inflates to (0,2,0)
26-
.d-banner--success .d-banner__icon { color: green; }
26+
.d-banner--positive .d-banner__icon { color: green; }
27+
.d-banner--warning .d-banner__icon { color: #ffa500; }
2728
```
2829

2930
## Element-Type Descendants: Always Wrap in `:where()`

apps/dialtone-documentation/docs/.vuepress/exampleComponents/ExampleResizableOffset.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Fixed Toolbar (48px)
1515
</dt-text>
1616
</dt-box>
17-
<dt-resizable-panel id="exo-left" initial-size="50p" class="d-bgc-success">
17+
<dt-resizable-panel id="exo-left" initial-size="50p" class="d-bgc-positive">
1818
<dt-box block-size="100p" inline-size="100p" class="d-plc-center">
1919
<dt-text as="p" align="center" kind="label" size="200" strength="bold" tone="positive" class="d-fco80">
2020
Left Panel

apps/dialtone-documentation/docs/.vuepress/theme/assets/less/dialtone-docs.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ code {
10671067
border-radius: var(--dt-size-radius-400);
10681068

10691069
&--do {
1070-
--usage-item-color-border: var(--dt-color-border-success);
1070+
--usage-item-color-border: var(--dt-color-border-positive);
10711071
}
10721072

10731073
&--dont {

apps/dialtone-documentation/docs/components/resizable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ When a fixed or absolutely positioned element (like a toolbar or header) overlap
326326
>
327327
Fixed Toolbar (48px)
328328
</dt-box>
329-
<dt-resizable-panel id="exo-left" initial-size="50p" class="d-bgc-success">
329+
<dt-resizable-panel id="exo-left" initial-size="50p" class="d-bgc-positive">
330330
Left Panel
331331
</dt-resizable-panel>
332332
<dt-resizable-handle />

apps/dialtone-documentation/docs/dialtone/whats-new/posts/2026-2-18.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ The base-to-semantic migration tool auto-replaces only where the mapping is unam
219219
```html
220220
<p class="d-fc-critical">Error message</p>
221221
<div class="d-bgc-secondary">Card</div>
222-
<div class="d-bc-success">Success</div>
222+
<div class="d-bc-positive">Success</div>
223223
```
224224

225225
</div>
@@ -337,9 +337,9 @@ The tool leaves unmapped base colors unchanged. Dialtone's ESLint rule (`depreca
337337
| `gold-50` | `d-bgc-warning-subtle` | `var(--dt-color-surface-warning-subtle)` |
338338
| `gold-100` | `d-bgc-warning` | `var(--dt-color-surface-warning)` |
339339
| `gold-400` | `d-bgc-warning-strong` | `var(--dt-color-surface-warning-strong)` |
340-
| `green-50` | `d-bgc-success-subtle` | `var(--dt-color-surface-success-subtle)` |
341-
| `green-100` | `d-bgc-success` | `var(--dt-color-surface-success)` |
342-
| `green-800` | `d-bgc-success-strong` | `var(--dt-color-surface-success-strong)` |
340+
| `green-50` | `d-bgc-positive-subtle` | `var(--dt-color-surface-positive-subtle)` |
341+
| `green-100` | `d-bgc-positive` | `var(--dt-color-surface-positive)` |
342+
| `green-800` | `d-bgc-positive-strong` | `var(--dt-color-surface-positive-strong)` |
343343
| `blue-50` | `d-bgc-info-subtle` | `var(--dt-color-surface-info-subtle)` |
344344
| `blue-100` | `d-bgc-info` | `var(--dt-color-surface-info)` |
345345
| `blue-800` | `d-bgc-info-strong` | `var(--dt-color-surface-info-strong)` |
@@ -354,9 +354,9 @@ The tool leaves unmapped base colors unchanged. Dialtone's ESLint rule (`depreca
354354
| `red-300` | `d-bc-critical-subtle` | `var(--dt-color-border-critical-subtle)` |
355355
| `red-600` | `d-bc-critical` | `var(--dt-color-border-critical)` |
356356
| `red-800` | `d-bc-critical-strong` | `var(--dt-color-border-critical-strong)` |
357-
| `green-300` | `d-bc-success-subtle` | `var(--dt-color-border-success-subtle)` |
358-
| `green-700` | `d-bc-success` | `var(--dt-color-border-success)` |
359-
| `green-900` | `d-bc-success-strong` | `var(--dt-color-border-success-strong)` |
357+
| `green-300` | `d-bc-positive-subtle` | `var(--dt-color-border-positive-subtle)` |
358+
| `green-700` | `d-bc-positive` | `var(--dt-color-border-positive)` |
359+
| `green-900` | `d-bc-positive-strong` | `var(--dt-color-border-positive-strong)` |
360360
| `gold-300` | `d-bc-warning-subtle` | `var(--dt-color-border-warning-subtle)` |
361361
| `gold-500` | `d-bc-warning` | `var(--dt-color-border-warning)` |
362362
| `gold-700` | `d-bc-warning-strong` | `var(--dt-color-border-warning-strong)` |

apps/dialtone-documentation/docs/guides/migration/color-stops/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ The base-to-semantic migration tool auto-replaces only where the mapping is unam
216216
```html
217217
<p class="d-fc-critical">Error message</p>
218218
<div class="d-bgc-secondary">Card</div>
219-
<div class="d-bc-success">Success</div>
219+
<div class="d-bc-positive">Success</div>
220220
```
221221

222222
</div>
@@ -334,9 +334,9 @@ The tool leaves unmapped base colors unchanged. Dialtone's ESLint rule (`depreca
334334
| `gold-50` | `d-bgc-warning-subtle` | `var(--dt-color-surface-warning-subtle)` |
335335
| `gold-100` | `d-bgc-warning` | `var(--dt-color-surface-warning)` |
336336
| `gold-400` | `d-bgc-warning-strong` | `var(--dt-color-surface-warning-strong)` |
337-
| `green-50` | `d-bgc-success-subtle` | `var(--dt-color-surface-success-subtle)` |
338-
| `green-100` | `d-bgc-success` | `var(--dt-color-surface-success)` |
339-
| `green-800` | `d-bgc-success-strong` | `var(--dt-color-surface-success-strong)` |
337+
| `green-50` | `d-bgc-positive-subtle` | `var(--dt-color-surface-positive-subtle)` |
338+
| `green-100` | `d-bgc-positive` | `var(--dt-color-surface-positive)` |
339+
| `green-800` | `d-bgc-positive-strong` | `var(--dt-color-surface-positive-strong)` |
340340
| `blue-50` | `d-bgc-info-subtle` | `var(--dt-color-surface-info-subtle)` |
341341
| `blue-100` | `d-bgc-info` | `var(--dt-color-surface-info)` |
342342
| `blue-800` | `d-bgc-info-strong` | `var(--dt-color-surface-info-strong)` |
@@ -351,9 +351,9 @@ The tool leaves unmapped base colors unchanged. Dialtone's ESLint rule (`depreca
351351
| `red-300` | `d-bc-critical-subtle` | `var(--dt-color-border-critical-subtle)` |
352352
| `red-600` | `d-bc-critical` | `var(--dt-color-border-critical)` |
353353
| `red-800` | `d-bc-critical-strong` | `var(--dt-color-border-critical-strong)` |
354-
| `green-300` | `d-bc-success-subtle` | `var(--dt-color-border-success-subtle)` |
355-
| `green-700` | `d-bc-success` | `var(--dt-color-border-success)` |
356-
| `green-900` | `d-bc-success-strong` | `var(--dt-color-border-success-strong)` |
354+
| `green-300` | `d-bc-positive-subtle` | `var(--dt-color-border-positive-subtle)` |
355+
| `green-700` | `d-bc-positive` | `var(--dt-color-border-positive)` |
356+
| `green-900` | `d-bc-positive-strong` | `var(--dt-color-border-positive-strong)` |
357357
| `gold-300` | `d-bc-warning-subtle` | `var(--dt-color-border-warning-subtle)` |
358358
| `gold-500` | `d-bc-warning` | `var(--dt-color-border-warning)` |
359359
| `gold-700` | `d-bc-warning-strong` | `var(--dt-color-border-warning-strong)` |

apps/dialtone-documentation/docs/utilities/borders/color.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Use `d-bc-{color}` to set an element's border color.
1919
<div class="d-p-200 d-ba d-baw2 d-bc-moderate">Moderate</div>
2020
<div class="d-p-200 d-ba d-baw2 d-bc-bold">Bold</div>
2121
<div class="d-p-200 d-ba d-baw2 d-bc-critical">Critical</div>
22-
<div class="d-p-200 d-ba d-baw2 d-bc-success">Success</div>
22+
<div class="d-p-200 d-ba d-baw2 d-bc-positive">Positive</div>
2323
<div class="d-p-200 d-ba d-baw2 d-bc-warning">Warning</div>
2424
</dt-stack>
2525
```

apps/dialtone-documentation/docs/utilities/index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ Apply a [semantic surface color](/utilities/backgrounds/color.md) to convey some
218218
<dt-icon name="alert-circle" size="200" />
219219
<dt-text>Info</dt-text>
220220
</dt-stack>
221-
<dt-stack direction="row" gap="100" class="d-bgc-success-strong d-p-100">
221+
<dt-stack direction="row" gap="100" class="d-bgc-positive-strong d-p-100">
222222
<dt-icon name="check-circle" size="200" />
223-
<dt-text>Success</dt-text>
223+
<dt-text>Positive</dt-text>
224224
</dt-stack>
225225
</dt-stack>
226226
```
@@ -240,9 +240,9 @@ Use the [DtText](/components/text.html) component for text styling. It provides
240240
<dt-icon name="alert-circle" size="200" />
241241
<dt-text kind="label" :size="200">Info</dt-text>
242242
</dt-stack>
243-
<dt-stack direction="row" gap="100" class="d-bgc-success-strong d-p-100">
243+
<dt-stack direction="row" gap="100" class="d-bgc-positive-strong d-p-100">
244244
<dt-icon name="check-circle" size="200" />
245-
<dt-text kind="label" :size="200">Success</dt-text>
245+
<dt-text kind="label" :size="200">Positive</dt-text>
246246
</dt-stack>
247247
</dt-stack>
248248
```
@@ -262,9 +262,9 @@ Refine the spacing by adjusting the [Stack](/components/stack.md) `gap` prop and
262262
<dt-icon name="alert-circle" size="200" />
263263
<dt-text kind="label" :size="200">Info</dt-text>
264264
</dt-stack>
265-
<dt-stack direction="row" gap="50" class="d-bgc-success-strong d-py-50 d-px-100">
265+
<dt-stack direction="row" gap="50" class="d-bgc-positive-strong d-py-50 d-px-100">
266266
<dt-icon name="check-circle" size="200" />
267-
<dt-text kind="label" :size="200">Success</dt-text>
267+
<dt-text kind="label" :size="200">Positive</dt-text>
268268
</dt-stack>
269269
</dt-stack>
270270
```
@@ -284,9 +284,9 @@ Add `d-bar-300` to each item for subtle rounded corners.
284284
<dt-icon name="alert-circle" size="200" />
285285
<dt-text kind="label" :size="200">Info</dt-text>
286286
</dt-stack>
287-
<dt-stack direction="row" gap="50" class="d-bar-300 d-bgc-success-strong d-py-50 d-px-100">
287+
<dt-stack direction="row" gap="50" class="d-bar-300 d-bgc-positive-strong d-py-50 d-px-100">
288288
<dt-icon name="check-circle" size="200" />
289-
<dt-text kind="label" :size="200">Success</dt-text>
289+
<dt-text kind="label" :size="200">Positive</dt-text>
290290
</dt-stack>
291291
</dt-stack>
292292
```

packages/combinator/src/variants/variants_select_menu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default {
4646
},
4747
},
4848

49-
'success validation': {
49+
'positive validation': {
5050
props: {
5151
label: { initialValue: 'Label' },
5252
options: {
@@ -56,7 +56,7 @@ export default {
5656
{ value: 3, label: 'Option 3' },
5757
],
5858
},
59-
messages: { initialValue: [{ message: 'Success validation message', type: 'success' }] },
59+
messages: { initialValue: [{ message: 'Positive validation message', type: 'positive' }] },
6060
},
6161
},
6262

packages/dialtone-css/.github/CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Component class names use the [Block Element Modifier (BEM)](http://getbem.com/n
3030
```less
3131
.d-banner {} // Block
3232
.d-banner__dialog {} // Element
33-
.d-banner--success {} // Modifier
33+
.d-banner--positive {} // Modifier
3434
```
3535

3636
### Selector specificity
@@ -52,12 +52,12 @@ When a modifier needs to change a property, prefer overriding a CSS custom prope
5252
background-color: var(--banner-color-background);
5353
}
5454

55-
.d-banner--success {
56-
--banner-color-background: var(--dt-color-surface-success);
55+
.d-banner--positive {
56+
--banner-color-background: var(--dt-color-surface-positive);
5757
}
5858

5959
// Avoid — inflates to (0,2,0)
60-
.d-banner--success .d-banner__icon {
60+
.d-banner--positive .d-banner__icon {
6161
color: green;
6262
}
6363
```
@@ -104,7 +104,7 @@ Do **not** wrap the component class itself, BEM modifiers, or state pseudo-class
104104
|----------|-------------|---------|
105105
| `.d-banner` | (0,1,0) | Ideal |
106106
| `.d-banner__dialog` | (0,1,0) | Ideal |
107-
| `.d-banner--success` | (0,1,0) | Ideal |
107+
| `.d-banner--positive` | (0,1,0) | Ideal |
108108
| `.d-table :where(th)` | (0,1,0) | Correct — element wrapped |
109109
| `.d-table th` | (0,1,1) | Avoid — bare element inflates specificity |
110110
| `.d-tablist--inverted .d-tab` | (0,2,0) | Acceptable — parent modifier affecting child |

0 commit comments

Comments
 (0)