opui-css 1.2.7 → 2.0.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 (39) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +32 -25
  3. package/dist/op+ui.css +4195 -4195
  4. package/dist/ui.css +4197 -4197
  5. package/package.json +1 -1
  6. package/src/components/accordion.css +172 -172
  7. package/src/components/alert.css +85 -85
  8. package/src/components/avatar.css +68 -68
  9. package/src/components/badge.css +101 -101
  10. package/src/components/button-group.css +69 -69
  11. package/src/components/button.css +267 -267
  12. package/src/components/card.css +82 -82
  13. package/src/components/checkbox-radio.css +123 -123
  14. package/src/components/chip.css +135 -135
  15. package/src/components/definition-list.css +65 -65
  16. package/src/components/dialog.css +59 -59
  17. package/src/components/divider.css +7 -7
  18. package/src/components/field-group.css +83 -83
  19. package/src/components/field.css +494 -494
  20. package/src/components/icon-button.css +40 -40
  21. package/src/components/list.css +317 -317
  22. package/src/components/progress.css +83 -83
  23. package/src/components/range.css +121 -121
  24. package/src/components/rich-text.css +210 -210
  25. package/src/components/select.css +163 -163
  26. package/src/components/snackbar.css +148 -148
  27. package/src/components/spinner.css +38 -38
  28. package/src/components/switch.css +189 -189
  29. package/src/components/tab-buttons.css +120 -120
  30. package/src/components/table.css +107 -107
  31. package/src/components/text-field.css +57 -57
  32. package/src/components/textarea.css +25 -25
  33. package/src/components/toggle-button-group.css +139 -139
  34. package/src/components/tooltip.css +94 -94
  35. package/src/components/typography.css +209 -209
  36. package/src/core/normalize.css +194 -194
  37. package/src/core/theme.css +160 -160
  38. package/src/core/utils.css +60 -60
  39. package/src/main.css +13 -13
@@ -1,160 +1,160 @@
1
- @layer theme {
2
- .light {
3
- --color-scheme: light;
4
- }
5
- .dark {
6
- --color-scheme: dark;
7
- }
8
-
9
- :where(html) {
10
- color-scheme: var(--color-scheme, light dark);
11
-
12
- --palette-hue: var(--oklch-teal);
13
- --palette-hue-rotate-by: 5;
14
- --palette-chroma: 0.89;
15
-
16
- /* Primary */
17
- --primary: var(--color-8);
18
- --primary-light: oklch(from var(--primary) calc(l * 1.25) c h);
19
- --primary-dark: oklch(from var(--primary) calc(l * 0.75) c h);
20
- --primary-contrast: var(--gray-1);
21
-
22
- /* Text */
23
- --text-color-1: light-dark(var(--gray-15), var(--gray-1));
24
- --text-color-1-contrast: light-dark(var(--gray-2), var(--gray-15));
25
- --text-color-2: light-dark(var(--gray-13), var(--gray-4));
26
- --text-color-2-contrast: light-dark(var(--gray-4), var(--gray-13));
27
-
28
- /* Surface */
29
- --surface-default: light-dark(var(--gray-1), var(--gray-13));
30
- --surface-filled: light-dark(var(--gray-3), var(--gray-15));
31
- --surface-tonal: light-dark(var(--gray-3), var(--gray-12));
32
- --surface-elevated: light-dark(var(--gray-1), var(--gray-12));
33
-
34
- /* Shadows */
35
- --shadow-color: light-dark(220 3% 15%, 220 40% 2%);
36
- --shadow-strength: light-dark(1%, 10%);
37
- --inner-shadow-highlight: light-dark(
38
- inset 0 -0.5px 0 0 #fff,
39
- inset 0 0.5px 0 0 #0001,
40
- inset 0 -0.5px 0 0 #fff1,
41
- inset 0 0.5px 0 0 #0007
42
- );
43
-
44
- /* Typography */
45
- --font-size-h1: var(--font-size-fluid-3, 3.5rem);
46
- --font-size-h2: var(--font-size-fluid-2, 2rem);
47
- --font-size-h3: var(--font-size-fluid-1, 1.5rem);
48
- --font-size-h4: var(--font-size-3, 1.25rem);
49
- --font-size-h5: var(--font-size-2, 1.1rem);
50
- --font-size-h6: var(--font-size-fluid-0, 1rem);
51
- --font-size-lg: var(--font-size-3, 1.25rem);
52
- --font-size-md: var(--font-size-fluid-0, 1rem);
53
- --font-size-sm: 0.875rem;
54
- --font-size-xs: var(--font-size-0, 0.75rem);
55
-
56
- /* Borders */
57
- --border-color: light-dark(var(--gray-4), var(--gray-12));
58
- --border-radius: var(--size-1);
59
- --border-width: 1px;
60
-
61
- /* Input Field */
62
- --field-border-color: var(--border-color);
63
- --field-border-radius: var(--size-1);
64
- --field-border-width: 1px;
65
- --field-size: 2.3lh;
66
- --field-size-small: 1.9lh;
67
-
68
- /* Button */
69
- --button-border-radius: var(--radius-round);
70
- /* Ripple effect */
71
- @media (prefers-reduced-motion: no-preference) {
72
- --button-ripple-size: 100%;
73
- --button-ripple-duration: 0.5s;
74
- }
75
- }
76
-
77
- /* Highlight colors */
78
- :where(.red, .error, del) {
79
- --palette-hue: var(--oklch-red, 25);
80
- --palette-chroma: 1;
81
- --palette-hue-rotate-by: 1;
82
- }
83
- :where(.blue, .ok, abbr, dfn) {
84
- --palette-hue: var(--oklch-blue, 210);
85
- --palette-chroma: 1;
86
- --palette-hue-rotate-by: 1;
87
- }
88
- :where(.green, .good, ins) {
89
- --palette-hue: var(--oklch-green, 145);
90
- --palette-chroma: 1;
91
- --palette-hue-rotate-by: 1;
92
- }
93
- :where(.orange, .warning) {
94
- --palette-hue: var(--oklch-orange, 75);
95
- --palette-chroma: 1;
96
- --palette-hue-rotate-by: 1;
97
- }
98
-
99
- :where(html) {
100
- --red: oklch(from var(--color-9) l 0.2 25);
101
- --blue: oklch(from var(--color-9) l 0.2 210);
102
- --green: oklch(from var(--color-9) l 0.2 145);
103
- --orange: oklch(from var(--color-7) l 0.2 75);
104
- }
105
-
106
- /* Gray palette */
107
- :where(html) {
108
- --gray-chroma: 0.01;
109
- --gray-lightness: 255;
110
-
111
- --gray-1: oklch(
112
- from var(--color-1) l var(--gray-chroma) var(--gray-lightness)
113
- );
114
- --gray-2: oklch(
115
- from var(--color-2) l var(--gray-chroma) var(--gray-lightness)
116
- );
117
- --gray-3: oklch(
118
- from var(--color-3) l var(--gray-chroma) var(--gray-lightness)
119
- );
120
- --gray-4: oklch(
121
- from var(--color-4) l var(--gray-chroma) var(--gray-lightness)
122
- );
123
- --gray-5: oklch(
124
- from var(--color-5) l var(--gray-chroma) var(--gray-lightness)
125
- );
126
- --gray-6: oklch(
127
- from var(--color-6) l var(--gray-chroma) var(--gray-lightness)
128
- );
129
- --gray-7: oklch(
130
- from var(--color-7) l var(--gray-chroma) var(--gray-lightness)
131
- );
132
- --gray-8: oklch(
133
- from var(--color-8) l var(--gray-chroma) var(--gray-lightness)
134
- );
135
- --gray-9: oklch(
136
- from var(--color-9) l var(--gray-chroma) var(--gray-lightness)
137
- );
138
- --gray-10: oklch(
139
- from var(--color-10) l var(--gray-chroma) var(--gray-lightness)
140
- );
141
- --gray-11: oklch(
142
- from var(--color-11) l var(--gray-chroma) var(--gray-lightness)
143
- );
144
- --gray-12: oklch(
145
- from var(--color-12) l var(--gray-chroma) var(--gray-lightness)
146
- );
147
- --gray-13: oklch(
148
- from var(--color-13) l var(--gray-chroma) var(--gray-lightness)
149
- );
150
- --gray-14: oklch(
151
- from var(--color-14) l var(--gray-chroma) var(--gray-lightness)
152
- );
153
- --gray-15: oklch(
154
- from var(--color-15) l var(--gray-chroma) var(--gray-lightness)
155
- );
156
- --gray-16: oklch(
157
- from var(--color-16) l var(--gray-chroma) var(--gray-lightness)
158
- );
159
- }
160
- }
1
+ @layer theme {
2
+ .light {
3
+ --color-scheme: light;
4
+ }
5
+ .dark {
6
+ --color-scheme: dark;
7
+ }
8
+
9
+ :where(html) {
10
+ color-scheme: var(--color-scheme, light dark);
11
+
12
+ --palette-hue: var(--oklch-teal);
13
+ --palette-hue-rotate-by: 5;
14
+ --palette-chroma: 0.89;
15
+
16
+ /* Primary */
17
+ --primary: var(--color-8);
18
+ --primary-light: oklch(from var(--primary) calc(l * 1.25) c h);
19
+ --primary-dark: oklch(from var(--primary) calc(l * 0.75) c h);
20
+ --primary-contrast: var(--gray-1);
21
+
22
+ /* Text */
23
+ --text-color-1: light-dark(var(--gray-15), var(--gray-1));
24
+ --text-color-1-contrast: light-dark(var(--gray-2), var(--gray-15));
25
+ --text-color-2: light-dark(var(--gray-13), var(--gray-4));
26
+ --text-color-2-contrast: light-dark(var(--gray-4), var(--gray-13));
27
+
28
+ /* Surface */
29
+ --surface-default: light-dark(var(--gray-1), var(--gray-13));
30
+ --surface-filled: light-dark(var(--gray-3), var(--gray-15));
31
+ --surface-tonal: light-dark(var(--gray-3), var(--gray-12));
32
+ --surface-elevated: light-dark(var(--gray-1), var(--gray-12));
33
+
34
+ /* Shadows */
35
+ --shadow-color: light-dark(220 3% 15%, 220 40% 2%);
36
+ --shadow-strength: light-dark(1%, 10%);
37
+ --inner-shadow-highlight: light-dark(
38
+ inset 0 -0.5px 0 0 #fff,
39
+ inset 0 0.5px 0 0 #0001,
40
+ inset 0 -0.5px 0 0 #fff1,
41
+ inset 0 0.5px 0 0 #0007
42
+ );
43
+
44
+ /* Typography */
45
+ --font-size-h1: var(--font-size-fluid-3, 3.5rem);
46
+ --font-size-h2: var(--font-size-fluid-2, 2rem);
47
+ --font-size-h3: var(--font-size-fluid-1, 1.5rem);
48
+ --font-size-h4: var(--font-size-3, 1.25rem);
49
+ --font-size-h5: var(--font-size-2, 1.1rem);
50
+ --font-size-h6: var(--font-size-fluid-0, 1rem);
51
+ --font-size-lg: var(--font-size-3, 1.25rem);
52
+ --font-size-md: var(--font-size-fluid-0, 1rem);
53
+ --font-size-sm: 0.875rem;
54
+ --font-size-xs: var(--font-size-0, 0.75rem);
55
+
56
+ /* Borders */
57
+ --border-color: light-dark(var(--gray-4), var(--gray-12));
58
+ --border-radius: var(--size-1);
59
+ --border-width: 1px;
60
+
61
+ /* Input Field */
62
+ --field-border-color: var(--border-color);
63
+ --field-border-radius: var(--size-1);
64
+ --field-border-width: 1px;
65
+ --field-size: 2.3lh;
66
+ --field-size-small: 1.9lh;
67
+
68
+ /* Button */
69
+ --button-border-radius: var(--radius-round);
70
+ /* Ripple effect */
71
+ @media (prefers-reduced-motion: no-preference) {
72
+ --button-ripple-size: 100%;
73
+ --button-ripple-duration: 0.5s;
74
+ }
75
+ }
76
+
77
+ /* Highlight colors */
78
+ :where(.red, .error, del) {
79
+ --palette-hue: var(--oklch-red, 25);
80
+ --palette-chroma: 1;
81
+ --palette-hue-rotate-by: 1;
82
+ }
83
+ :where(.blue, .ok, abbr, dfn) {
84
+ --palette-hue: var(--oklch-blue, 210);
85
+ --palette-chroma: 1;
86
+ --palette-hue-rotate-by: 1;
87
+ }
88
+ :where(.green, .good, ins) {
89
+ --palette-hue: var(--oklch-green, 145);
90
+ --palette-chroma: 1;
91
+ --palette-hue-rotate-by: 1;
92
+ }
93
+ :where(.orange, .warning) {
94
+ --palette-hue: var(--oklch-orange, 75);
95
+ --palette-chroma: 1;
96
+ --palette-hue-rotate-by: 1;
97
+ }
98
+
99
+ :where(html) {
100
+ --red: oklch(from var(--color-9) l 0.2 25);
101
+ --blue: oklch(from var(--color-9) l 0.2 210);
102
+ --green: oklch(from var(--color-9) l 0.2 145);
103
+ --orange: oklch(from var(--color-7) l 0.2 75);
104
+ }
105
+
106
+ /* Gray palette */
107
+ :where(html) {
108
+ --gray-chroma: 0.01;
109
+ --gray-lightness: 255;
110
+
111
+ --gray-1: oklch(
112
+ from var(--color-1) l var(--gray-chroma) var(--gray-lightness)
113
+ );
114
+ --gray-2: oklch(
115
+ from var(--color-2) l var(--gray-chroma) var(--gray-lightness)
116
+ );
117
+ --gray-3: oklch(
118
+ from var(--color-3) l var(--gray-chroma) var(--gray-lightness)
119
+ );
120
+ --gray-4: oklch(
121
+ from var(--color-4) l var(--gray-chroma) var(--gray-lightness)
122
+ );
123
+ --gray-5: oklch(
124
+ from var(--color-5) l var(--gray-chroma) var(--gray-lightness)
125
+ );
126
+ --gray-6: oklch(
127
+ from var(--color-6) l var(--gray-chroma) var(--gray-lightness)
128
+ );
129
+ --gray-7: oklch(
130
+ from var(--color-7) l var(--gray-chroma) var(--gray-lightness)
131
+ );
132
+ --gray-8: oklch(
133
+ from var(--color-8) l var(--gray-chroma) var(--gray-lightness)
134
+ );
135
+ --gray-9: oklch(
136
+ from var(--color-9) l var(--gray-chroma) var(--gray-lightness)
137
+ );
138
+ --gray-10: oklch(
139
+ from var(--color-10) l var(--gray-chroma) var(--gray-lightness)
140
+ );
141
+ --gray-11: oklch(
142
+ from var(--color-11) l var(--gray-chroma) var(--gray-lightness)
143
+ );
144
+ --gray-12: oklch(
145
+ from var(--color-12) l var(--gray-chroma) var(--gray-lightness)
146
+ );
147
+ --gray-13: oklch(
148
+ from var(--color-13) l var(--gray-chroma) var(--gray-lightness)
149
+ );
150
+ --gray-14: oklch(
151
+ from var(--color-14) l var(--gray-chroma) var(--gray-lightness)
152
+ );
153
+ --gray-15: oklch(
154
+ from var(--color-15) l var(--gray-chroma) var(--gray-lightness)
155
+ );
156
+ --gray-16: oklch(
157
+ from var(--color-16) l var(--gray-chroma) var(--gray-lightness)
158
+ );
159
+ }
160
+ }
@@ -1,60 +1,60 @@
1
- @layer utils {
2
- /*
3
- Screen-reader only
4
- When you visibly want to hide an element but make it accessible for screen readers.
5
- */
6
- .sr-only {
7
- block-size: 1px;
8
- clip-path: inset(50%);
9
- inline-size: 1px;
10
- overflow: hidden;
11
- position: absolute;
12
- white-space: nowrap;
13
- }
14
-
15
- /* Hover and active effect for checkbox, radio and icon buttons */
16
- :where(.checkbox input, .radio input, .icon-button) {
17
- --isLTR: 1;
18
- --isRTL: -1;
19
-
20
- position: relative;
21
- transform-style: preserve-3d;
22
-
23
- &:dir(rtl) {
24
- --isLTR: -1;
25
- --isRTL: 1;
26
- }
27
-
28
- &:where(:not([disabled])) {
29
- &:hover:before {
30
- --thumb-scale: 1;
31
- }
32
-
33
- &:active:before {
34
- --thumb-scale: 1.1;
35
- }
36
-
37
- &::before {
38
- --thumb-scale: 0.01;
39
- --highlight-size: 150%;
40
-
41
- background-color: oklch(0.6 0 0 / 0.2);
42
- block-size: var(--highlight-size);
43
- clip-path: circle(50%);
44
- content: "";
45
- inline-size: var(--highlight-size);
46
- inset-block-start: 50%;
47
- inset-inline-start: 50%;
48
- position: absolute;
49
- transform-origin: center center;
50
- transform: translateX(calc(var(--isRTL) * 50%)) translateY(-50%)
51
- translateZ(-1px) scale(var(--thumb-scale));
52
- will-change: transform;
53
-
54
- @media (prefers-reduced-motion: no-preference) {
55
- transition: transform 0.2s ease;
56
- }
57
- }
58
- }
59
- }
60
- }
1
+ @layer utils {
2
+ /*
3
+ Screen-reader only
4
+ When you visibly want to hide an element but make it accessible for screen readers.
5
+ */
6
+ .sr-only {
7
+ block-size: 1px;
8
+ clip-path: inset(50%);
9
+ inline-size: 1px;
10
+ overflow: hidden;
11
+ position: absolute;
12
+ white-space: nowrap;
13
+ }
14
+
15
+ /* Hover and active effect for checkbox, radio and icon buttons */
16
+ :where(.checkbox input, .radio input, .icon-button) {
17
+ --isLTR: 1;
18
+ --isRTL: -1;
19
+
20
+ position: relative;
21
+ transform-style: preserve-3d;
22
+
23
+ &:dir(rtl) {
24
+ --isLTR: -1;
25
+ --isRTL: 1;
26
+ }
27
+
28
+ &:where(:not([disabled])) {
29
+ &:hover:before {
30
+ --thumb-scale: 1;
31
+ }
32
+
33
+ &:active:before {
34
+ --thumb-scale: 1.1;
35
+ }
36
+
37
+ &::before {
38
+ --thumb-scale: 0.01;
39
+ --highlight-size: 150%;
40
+
41
+ background-color: oklch(0.6 0 0 / 0.2);
42
+ block-size: var(--highlight-size);
43
+ clip-path: circle(50%);
44
+ content: "";
45
+ inline-size: var(--highlight-size);
46
+ inset-block-start: 50%;
47
+ inset-inline-start: 50%;
48
+ position: absolute;
49
+ transform-origin: center center;
50
+ transform: translateX(calc(var(--isRTL) * 50%)) translateY(-50%)
51
+ translateZ(-1px) scale(var(--thumb-scale));
52
+ will-change: transform;
53
+
54
+ @media (prefers-reduced-motion: no-preference) {
55
+ transition: transform 0.2s ease;
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
package/src/main.css CHANGED
@@ -1,13 +1,13 @@
1
- /*
2
- * Open Props
3
- * Import as many props as you need here.
4
- * https://unpkg.com/browse/open-props@2.0.0-beta.5/css
5
- */
6
- @import "open-props/css/media-queries.css";
7
- @import "open-props/index.css" layer(openprops);
8
- @import "open-props/css/sizes/media.css" layer(openprops);
9
- @import "open-props/css/font/lineheight.css" layer(openprops);
10
- @import "open-props/css/color/hues.oklch.css" layer(openprops);
11
-
12
- /* OPUI Core */
13
- @import "./opui.css";
1
+ /*
2
+ * Open Props
3
+ * Import as many props as you need here.
4
+ * https://unpkg.com/browse/open-props@2.0.0-beta.5/css
5
+ */
6
+ @import "open-props/css/media-queries.css";
7
+ @import "open-props/index.css" layer(openprops);
8
+ @import "open-props/css/sizes/media.css" layer(openprops);
9
+ @import "open-props/css/font/lineheight.css" layer(openprops);
10
+ @import "open-props/css/color/hues.oklch.css" layer(openprops);
11
+
12
+ /* OPUI Core */
13
+ @import "./opui.css";