@codenhub/styles 0.0.3 → 0.1.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 (75) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +52 -0
  3. package/README.md +60 -90
  4. package/dist/aesthetics/chunky-tile.css +1 -0
  5. package/dist/aesthetics/glass.css +1 -0
  6. package/dist/aesthetics/index.css +2 -0
  7. package/dist/aesthetics/neobrutalism.css +1 -0
  8. package/dist/aesthetics/pixel.css +1 -0
  9. package/dist/components.css +2 -2
  10. package/dist/index.css +2 -2
  11. package/dist/native.css +2 -0
  12. package/dist/theme.css +2 -2
  13. package/dist/tw/aesthetics/chunky-tile.css +107 -0
  14. package/dist/tw/aesthetics/glass.css +66 -0
  15. package/dist/tw/aesthetics/index.css +9 -0
  16. package/dist/tw/aesthetics/neobrutalism.css +63 -0
  17. package/dist/tw/aesthetics/pixel.css +88 -0
  18. package/dist/tw/box.css +185 -0
  19. package/dist/tw/components/button.css +88 -0
  20. package/dist/tw/components/feedback.css +163 -0
  21. package/dist/tw/components/form.css +601 -0
  22. package/dist/tw/components/index.css +18 -0
  23. package/dist/tw/components/loader.css +122 -0
  24. package/dist/tw/components/surface.css +98 -0
  25. package/dist/tw/components/tooltip.css +132 -0
  26. package/dist/tw/elevation.css +39 -0
  27. package/dist/tw/index.css +12 -0
  28. package/dist/tw/intent.css +189 -0
  29. package/dist/tw/native.css +203 -0
  30. package/dist/tw/presentation.css +77 -0
  31. package/dist/tw/reset.css +142 -0
  32. package/dist/tw/theme.css +218 -0
  33. package/dist/tw/typography.css +34 -0
  34. package/dist/tw/utilities/content.css +349 -0
  35. package/dist/tw/utilities/index.css +6 -0
  36. package/dist/tw/utilities/layout.css +107 -0
  37. package/docs/accessibility.md +43 -14
  38. package/docs/concepts.md +94 -0
  39. package/docs/index.md +62 -73
  40. package/docs/integrating/astro.md +29 -0
  41. package/docs/integrating/index.md +32 -0
  42. package/docs/integrating/nextjs.md +44 -0
  43. package/docs/integrating/svelte.md +37 -0
  44. package/docs/integrating/tailwind.md +40 -0
  45. package/docs/integrating/vue.md +25 -0
  46. package/docs/setup.md +116 -0
  47. package/docs/usage/aesthetics.md +197 -0
  48. package/docs/usage/buttons.md +74 -0
  49. package/docs/usage/composing.md +218 -0
  50. package/docs/usage/content-and-layout.md +200 -0
  51. package/docs/usage/customizing.md +213 -0
  52. package/docs/usage/feedback.md +117 -0
  53. package/docs/usage/forms.md +177 -0
  54. package/docs/usage/index.md +32 -0
  55. package/docs/usage/theming.md +210 -0
  56. package/docs/usage/tooltips.md +45 -0
  57. package/llms-full.txt +2122 -0
  58. package/llms.txt +26 -0
  59. package/package.json +96 -32
  60. package/docs/classes.md +0 -198
  61. package/docs/roadmap.md +0 -34
  62. package/docs/tests.md +0 -128
  63. package/docs/tokens.md +0 -101
  64. package/src/components/button.css +0 -155
  65. package/src/components/feedback.css +0 -214
  66. package/src/components/form.css +0 -296
  67. package/src/components/index.css +0 -9
  68. package/src/components/loader.css +0 -56
  69. package/src/components/surface.css +0 -6
  70. package/src/components/tooltip.css +0 -60
  71. package/src/index.css +0 -7
  72. package/src/overrides.css +0 -76
  73. package/src/theme.css +0 -136
  74. package/src/typography.css +0 -30
  75. package/src/utilities.css +0 -40
package/docs/tokens.md DELETED
@@ -1,101 +0,0 @@
1
- # @codenhub/styles Tokens
2
-
3
- **Status:** IMPLEMENTED
4
- **Last updated:** 2026-06-18
5
- **Scope:** Public CSS variable contract for `@codenhub/styles`.
6
-
7
- Tokens are CSS custom properties. Default values apply by default. `.dark` may override any token value for that subtree.
8
-
9
- ```html
10
- <section class="dark">
11
- <article class="card">Dark token subtree</article>
12
- </section>
13
- ```
14
-
15
- ## Color Tokens
16
-
17
- | Token | Purpose |
18
- | ------------------------------ | ------------------------------------------------------------------------------------------------------------- |
19
- | `--color-primary` | Primary action/content color. |
20
- | `--color-primary-contrast` | Text/icon color on primary filled surface. |
21
- | `--color-primary-hover` | Primary hover state. |
22
- | `--color-primary-subtle` | Low-emphasis companion tone for primary. Use as soft surface or subtle background. |
23
- | `--color-primary-strong` | High-emphasis companion tone for primary. Use as readable text, icon, or border on subtle surfaces. |
24
- | `--color-accent` | Secondary/accent surface. |
25
- | `--color-accent-contrast` | Text/icon color on accent filled surface. |
26
- | `--color-accent-hover` | Accent hover state. |
27
- | `--color-accent-subtle` | Low-emphasis companion tone for accent. Use as soft surface or subtle background. |
28
- | `--color-accent-strong` | High-emphasis companion tone for accent. Use as readable text, icon, or border on subtle surfaces. |
29
- | `--color-border` | Default border color. |
30
- | `--color-border-hover` | Interactive border color. |
31
- | `--color-background` | Page and default raised surface background. |
32
- | `--color-foreground` | Subtle raised foreground surface. |
33
- | `--color-surface` | Nested or muted surface. |
34
- | `--color-text` | Primary text color. |
35
- | `--color-text-secondary` | Secondary text color. |
36
- | `--color-text-contrast` | Text/icon color on text filled surface. |
37
- | `--color-text-hover` | Text hover state. |
38
- | `--color-text-subtle` | Low-emphasis companion tone for text. Use as soft surface or subtle background. |
39
- | `--color-text-strong` | High-emphasis companion tone for text. Use as readable text, icon, or border on subtle surfaces. |
40
- | `--color-success` | Success state color. |
41
- | `--color-success-contrast` | Text/icon color on success filled surface. Meets 3:1 UI component contrast against `--color-success`. |
42
- | `--color-success-hover` | Success hover tone. |
43
- | `--color-success-subtle` | Low-emphasis companion tone for success. |
44
- | `--color-success-strong` | High-emphasis companion tone for success. |
45
- | `--color-warning` | Warning state color. |
46
- | `--color-warning-contrast` | Text/icon color on warning filled surface. Meets 3:1 UI component contrast against `--color-warning`. |
47
- | `--color-warning-hover` | Warning hover tone. |
48
- | `--color-warning-subtle` | Low-emphasis companion tone for warning. |
49
- | `--color-warning-strong` | High-emphasis companion tone for warning. |
50
- | `--color-destructive` | Destructive/error state color. |
51
- | `--color-destructive-contrast` | Text/icon color on destructive filled surface. Meets 3:1 UI component contrast against `--color-destructive`. |
52
- | `--color-destructive-hover` | Destructive hover tone. |
53
- | `--color-destructive-subtle` | Low-emphasis companion tone for destructive. |
54
- | `--color-destructive-strong` | High-emphasis companion tone for destructive. |
55
- | `--color-info` | Informational state color. |
56
- | `--color-info-contrast` | Text/icon color on info filled surface. Meets 3:1 UI component contrast against `--color-info`. |
57
- | `--color-info-hover` | Info hover tone. |
58
- | `--color-info-subtle` | Low-emphasis companion tone for info. |
59
- | `--color-info-strong` | High-emphasis companion tone for info. |
60
-
61
- > **Intent token contract**: color intent tokens own meaning and tone variants. Components map an intent palette into scoped component slots, and presentation classes decide which slots to consume. Theme changes belong in token values such as `.dark`, not broad component-level theme checks. Component-level theme handling should exist only when a component has an internal structure that cannot be expressed through the token palette alone.
62
-
63
- ## Foundation Tokens
64
-
65
- Foundation tokens are not aliases for one color. They define layout, shape, motion, focus, depth, and layering behavior used by helper classes.
66
-
67
- | Token | Purpose |
68
- | --------------------------- | ---------------------------------------------------------------------------- |
69
- | `--font-default` | Default app font family. |
70
- | `--container-narrow` | Narrow content width. |
71
- | `--container-max` | Default content width. |
72
- | `--container-wide` | Wide content width. |
73
- | `--layout-gutter` | Responsive inline page padding. |
74
- | `--layout-section-block` | Responsive section vertical padding. |
75
- | `--layout-stack-gap` | Default vertical stack gap. |
76
- | `--layout-cluster-gap` | Default horizontal/wrapped cluster gap. |
77
- | `--layout-grid-min` | Minimum column width for `.auto-grid`. |
78
- | `--radius-control` | Radius for buttons, inputs, tooltips, and compact UI. |
79
- | `--radius-surface` | Radius for cards, panels, and alerts. |
80
- | `--control-height` | Default minimum height for controls. |
81
- | `--border-width` | Default border width. |
82
- | `--elevation-low` | Elevation for surface-level components such as cards and panels. |
83
- | `--elevation-mid` | Elevation for elevated components such as dropdowns and floating containers. |
84
- | `--elevation-high` | Elevation for tooltips and inline overlays. |
85
- | `--focus-ring` | Focus-visible ring color. |
86
- | `--focus-ring-offset` | Focus-visible outline offset. |
87
- | `--focus-ring-width` | Focus-visible outline/ring width. |
88
- | `--motion-duration-fast` | Fast transition for buttons and input interactions (`120ms`). |
89
- | `--motion-duration-normal` | Normal transition for layout and modals (`200ms`). |
90
- | `--motion-duration-slow` | Slow animation for skeleton loaders and progress bars (`400ms`). |
91
- | `--motion-ease` | Default easing curve. |
92
- | `--z-popover` | Popover/tooltip z-index. |
93
- | `--surface-hover-transform` | The transform applied on interactive card/panel hover. |
94
- | `--breakpoint-xs` | Extra-small Tailwind responsive breakpoint. |
95
- | `--breakpoint-2xl` | Extended large Tailwind responsive breakpoint. |
96
-
97
- ## Component Internals
98
-
99
- Component classes may define scoped implementation variables such as `--button-*`, `--surface-*`, `--control-*`, `--feedback-*`, and `--tooltip-*`. These variables are internal wiring for class composition and are not the public token contract.
100
-
101
- Consumers should customize broad behavior through color, foundation, motion, elevation, radius, layout, and focus tokens first. The only supported component-scoped input is `--progress-value` on the child fill element inside `.progress`, because consumers must provide a value such as `64%`.
@@ -1,155 +0,0 @@
1
- @import "tailwindcss";
2
- @import "../theme.css";
3
-
4
- @utility btn {
5
- --button-color: var(--color-text);
6
- --button-contrast: var(--color-text-contrast);
7
- --button-hover: var(--color-text-hover);
8
- --button-subtle: var(--color-text-subtle);
9
- --button-strong: var(--color-text-strong);
10
- --button-bg: var(--button-color);
11
- --button-fg: var(--button-contrast);
12
- --button-border: var(--button-bg);
13
- --button-hover-bg: var(--button-hover);
14
- --button-hover-fg: var(--button-fg);
15
- --button-hover-border: var(--button-hover-bg);
16
- --button-text: var(--button-strong);
17
- --button-soft-bg: var(--button-subtle);
18
- --button-subtle-hover-bg: color-mix(in srgb, var(--button-soft-bg) 80%, transparent);
19
- --button-soft-hover-bg: color-mix(in srgb, var(--button-soft-bg) 84%, var(--button-text));
20
- --button-spinner: var(--button-fg);
21
-
22
- @apply relative inline-flex min-h-(--control-height,2.5rem) w-fit items-center justify-center gap-2 rounded-(--radius-control) bg-(--button-bg) px-4 py-2 font-semibold whitespace-nowrap text-(--button-fg) no-underline transition-[background-color,border-color,color,opacity,transform] duration-(--motion-duration-fast) ease-(--motion-ease) select-none;
23
- border: var(--border-width) solid var(--button-border);
24
-
25
- &.primary {
26
- --button-color: var(--color-primary);
27
- --button-contrast: var(--color-primary-contrast);
28
- --button-hover: var(--color-primary-hover);
29
- --button-subtle: var(--color-primary-subtle);
30
- --button-strong: var(--color-primary-strong);
31
- }
32
-
33
- &.secondary {
34
- --button-color: var(--color-accent);
35
- --button-contrast: var(--color-accent-contrast);
36
- --button-hover: var(--color-accent-hover);
37
- --button-subtle: var(--color-accent-subtle);
38
- --button-strong: var(--color-accent-strong);
39
- }
40
-
41
- &.success {
42
- --button-color: var(--color-success);
43
- --button-contrast: var(--color-success-contrast);
44
- --button-hover: var(--color-success-hover);
45
- --button-subtle: var(--color-success-subtle);
46
- --button-strong: var(--color-success-strong);
47
- }
48
-
49
- &.warning {
50
- --button-color: var(--color-warning);
51
- --button-contrast: var(--color-warning-contrast);
52
- --button-hover: var(--color-warning-hover);
53
- --button-subtle: var(--color-warning-subtle);
54
- --button-strong: var(--color-warning-strong);
55
- }
56
-
57
- &.destructive,
58
- &.danger,
59
- &.error {
60
- --button-color: var(--color-destructive);
61
- --button-contrast: var(--color-destructive-contrast);
62
- --button-hover: var(--color-destructive-hover);
63
- --button-subtle: var(--color-destructive-subtle);
64
- --button-strong: var(--color-destructive-strong);
65
- }
66
-
67
- &.info {
68
- --button-color: var(--color-info);
69
- --button-contrast: var(--color-info-contrast);
70
- --button-hover: var(--color-info-hover);
71
- --button-subtle: var(--color-info-subtle);
72
- --button-strong: var(--color-info-strong);
73
- }
74
-
75
- &.out {
76
- --button-spinner: var(--button-text);
77
-
78
- @apply bg-transparent text-(--button-color);
79
- border: calc(var(--border-width) * 2) solid var(--button-color);
80
-
81
- &:not(:disabled, .disabled, [aria-disabled="true"], [data-disabled]):hover {
82
- @apply border-(--button-color) bg-(--button-subtle) text-(--button-color);
83
- }
84
-
85
- &.fill {
86
- &:not(:disabled, .disabled, [aria-disabled="true"], [data-disabled]):hover {
87
- @apply border-(--button-color) bg-(--button-color) text-(--button-contrast);
88
- }
89
- }
90
- }
91
-
92
- &.ghost {
93
- --button-spinner: var(--button-text);
94
-
95
- @apply border-transparent bg-transparent text-(--button-text);
96
-
97
- &:not(:disabled, .disabled, [aria-disabled="true"], [data-disabled]):hover {
98
- @apply border-transparent bg-(--button-subtle-hover-bg) text-(--button-text);
99
- }
100
- }
101
-
102
- &.soft {
103
- --button-spinner: var(--button-text);
104
-
105
- @apply border-transparent bg-(--button-soft-bg) text-(--button-text);
106
-
107
- &:not(:disabled, .disabled, [aria-disabled="true"], [data-disabled]):hover {
108
- @apply border-transparent bg-(--button-soft-hover-bg) text-(--button-text);
109
- }
110
- }
111
-
112
- &.sm {
113
- @apply min-h-8 px-3 py-1 text-sm;
114
- }
115
-
116
- &.lg {
117
- @apply min-h-12 px-5 py-2.5 text-[1.0625rem];
118
- }
119
-
120
- &.icon {
121
- @apply aspect-square min-w-(--control-height,2.5rem) p-2;
122
-
123
- aspect-ratio: 1;
124
- }
125
-
126
- &.pill {
127
- @apply rounded-full;
128
- }
129
-
130
- &:not(:disabled, .disabled, [aria-disabled="true"], [data-disabled]):hover {
131
- &:not(.out, .ghost, .soft) {
132
- @apply border-(--button-hover-border) bg-(--button-hover-bg) text-(--button-hover-fg);
133
- }
134
- }
135
-
136
- &:disabled,
137
- &.disabled,
138
- &[aria-disabled="true"],
139
- &[data-disabled] {
140
- @apply cursor-not-allowed;
141
-
142
- opacity: 0.58;
143
- }
144
-
145
- &.loading {
146
- @apply pointer-events-none text-transparent! transition-[opacity,transform];
147
-
148
- &::after {
149
- @apply absolute top-[calc(50%+var(--border-width))] left-[calc(50%+var(--border-width))] block size-4 -translate-1/2 rounded-full bg-(--button-spinner);
150
-
151
- content: "";
152
- @apply ai;
153
- }
154
- }
155
- }
@@ -1,214 +0,0 @@
1
- @import "tailwindcss";
2
- @import "../theme.css";
3
-
4
- @keyframes anim-skeleton {
5
- 0% {
6
- background-position: 200% 0;
7
- }
8
-
9
- 100% {
10
- background-position: -200% 0;
11
- }
12
- }
13
-
14
- @utility alert {
15
- --feedback-color: var(--color-text);
16
- --feedback-contrast: var(--color-text-contrast);
17
- --feedback-surface: color-mix(in srgb, var(--feedback-color) 12%, var(--color-background));
18
- --feedback-border: color-mix(in srgb, var(--feedback-color) 42%, var(--color-border));
19
-
20
- @apply flex rounded-(--radius-surface) bg-(--feedback-surface) p-4 leading-5 text-(--feedback-color);
21
- border: var(--border-width) solid var(--feedback-border);
22
-
23
- &.primary {
24
- --feedback-color: var(--color-primary);
25
- --feedback-contrast: var(--color-primary-contrast);
26
- }
27
-
28
- &.secondary {
29
- --feedback-color: var(--color-accent);
30
- --feedback-contrast: var(--color-accent-contrast);
31
- }
32
-
33
- &.success {
34
- --feedback-color: var(--color-success);
35
- --feedback-contrast: var(--color-success-contrast);
36
- }
37
-
38
- &.warning {
39
- --feedback-color: var(--color-warning);
40
- --feedback-contrast: var(--color-warning-contrast);
41
- }
42
-
43
- &.destructive,
44
- &.danger,
45
- &.error {
46
- --feedback-color: var(--color-destructive);
47
- --feedback-contrast: var(--color-destructive-contrast);
48
- }
49
-
50
- &.info {
51
- --feedback-color: var(--color-info);
52
- --feedback-contrast: var(--color-info-contrast);
53
- }
54
-
55
- &.flat {
56
- @apply bg-(--feedback-color) text-(--feedback-contrast);
57
- border-color: var(--feedback-color);
58
- }
59
-
60
- &.soft {
61
- @apply border-transparent bg-(--feedback-surface) text-(--feedback-color);
62
- }
63
-
64
- &.left-accent {
65
- @apply border-y-transparent border-r-transparent bg-(--feedback-surface) text-(--feedback-color);
66
- border-left-width: 4px;
67
- border-left-color: var(--feedback-color);
68
- }
69
-
70
- &.icon {
71
- @apply relative pl-11;
72
-
73
- &::before {
74
- @apply absolute top-4 left-4 block size-5 bg-current;
75
-
76
- content: "";
77
- mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>');
78
- -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>');
79
- mask-size: contain;
80
- -webkit-mask-size: contain;
81
- mask-repeat: no-repeat;
82
- -webkit-mask-repeat: no-repeat;
83
- mask-position: center;
84
- -webkit-mask-position: center;
85
- }
86
-
87
- &.success::before {
88
- mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>');
89
- -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>');
90
- }
91
-
92
- &.warning::before {
93
- mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>');
94
- -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>');
95
- }
96
-
97
- &.destructive::before,
98
- &.danger::before,
99
- &.error::before {
100
- mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/></svg>');
101
- -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/></svg>');
102
- }
103
-
104
- &.info::before {
105
- mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>');
106
- -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>');
107
- }
108
- }
109
- }
110
-
111
- @utility badge {
112
- --feedback-color: var(--color-text);
113
- --feedback-contrast: var(--color-text-contrast);
114
- --feedback-surface: color-mix(in srgb, var(--feedback-color) 12%, var(--color-background));
115
- --feedback-border: color-mix(in srgb, var(--feedback-color) 42%, var(--color-border));
116
-
117
- @apply inline-flex min-h-6 w-fit items-center gap-1 rounded-full bg-(--feedback-surface) px-2.5 text-xs font-bold text-(--feedback-color);
118
- border: var(--border-width) solid var(--feedback-border);
119
-
120
- &.primary {
121
- --feedback-color: var(--color-primary);
122
- --feedback-contrast: var(--color-primary-contrast);
123
- }
124
-
125
- &.secondary {
126
- --feedback-color: var(--color-accent);
127
- --feedback-contrast: var(--color-accent-contrast);
128
- }
129
-
130
- &.success {
131
- --feedback-color: var(--color-success);
132
- --feedback-contrast: var(--color-success-contrast);
133
- }
134
-
135
- &.warning {
136
- --feedback-color: var(--color-warning);
137
- --feedback-contrast: var(--color-warning-contrast);
138
- }
139
-
140
- &.destructive,
141
- &.danger,
142
- &.error {
143
- --feedback-color: var(--color-destructive);
144
- --feedback-contrast: var(--color-destructive-contrast);
145
- }
146
-
147
- &.info {
148
- --feedback-color: var(--color-info);
149
- --feedback-contrast: var(--color-info-contrast);
150
- }
151
-
152
- &.flat {
153
- @apply bg-(--feedback-color) text-(--feedback-contrast);
154
- border-color: var(--feedback-color);
155
- }
156
-
157
- &.soft {
158
- @apply border-transparent;
159
- }
160
- }
161
-
162
- @utility skeleton {
163
- @apply min-h-4 w-full rounded-(--radius-control);
164
-
165
- animation: anim-skeleton calc(var(--motion-duration-slow) * 4) linear infinite;
166
- background: linear-gradient(90deg, var(--color-surface), var(--color-foreground), var(--color-surface));
167
- background-size: 200% 100%;
168
- }
169
-
170
- @utility progress {
171
- --progress-color: var(--color-text);
172
- --progress-surface: color-mix(var(--color-text-subtle) 60%, transparent);
173
-
174
- @apply h-2.5 w-full overflow-hidden rounded-full bg-(--progress-surface);
175
-
176
- > * {
177
- @apply block h-full transition-[width] duration-(--motion-duration-slow) ease-(--motion-ease);
178
-
179
- background-color: var(--progress-color);
180
- width: var(--progress-value, 0%);
181
- }
182
-
183
- &.primary {
184
- --progress-color: var(--color-primary);
185
- --progress-surface: color-mix(var(--color-primary-subtle) 60%, transparent);
186
- }
187
-
188
- &.secondary {
189
- --progress-color: var(--color-accent);
190
- --progress-surface: color-mix(var(--color-accent-subtle) 60%, transparent);
191
- }
192
-
193
- &.success {
194
- --progress-color: var(--color-success);
195
- --progress-surface: color-mix(var(--color-success-subtle) 60%, transparent);
196
- }
197
-
198
- &.warning {
199
- --progress-color: var(--color-warning);
200
- --progress-surface: color-mix(var(--color-warning-subtle) 60%, transparent);
201
- }
202
-
203
- &.destructive,
204
- &.danger,
205
- &.error {
206
- --progress-color: var(--color-destructive);
207
- --progress-surface: color-mix(var(--color-destructive-subtle) 60%, transparent);
208
- }
209
-
210
- &.info {
211
- --progress-color: var(--color-info);
212
- --progress-surface: color-mix(var(--color-info-subtle) 60%, transparent);
213
- }
214
- }