opui-css 2.4.0 → 3.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 (80) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +23 -7
  3. package/dist/op.css +1 -14
  4. package/dist/{op+ui.css → theme-one.css} +4378 -4155
  5. package/dist/{ui.css → theme-two.css} +4097 -4100
  6. package/package.json +10 -8
  7. package/src/core/normalize.css +196 -196
  8. package/src/core/utils.css +60 -60
  9. package/src/open-props.css +1 -1
  10. package/src/{components → themes/theme-one/components}/accordion.css +172 -172
  11. package/src/{components → themes/theme-one/components}/alert.css +85 -85
  12. package/src/{components → themes/theme-one/components}/avatar.css +68 -68
  13. package/src/{components → themes/theme-one/components}/badge.css +101 -101
  14. package/src/{components → themes/theme-one/components}/button-group.css +69 -69
  15. package/src/{components → themes/theme-one/components}/button.css +267 -267
  16. package/src/{components → themes/theme-one/components}/card.css +82 -82
  17. package/src/{components → themes/theme-one/components}/checkbox-radio.css +123 -123
  18. package/src/{components → themes/theme-one/components}/chip.css +135 -135
  19. package/src/{components → themes/theme-one/components}/definition-list.css +65 -65
  20. package/src/{components → themes/theme-one/components}/dialog.css +59 -59
  21. package/src/{components → themes/theme-one/components}/divider.css +7 -7
  22. package/src/{components → themes/theme-one/components}/field-group.css +83 -83
  23. package/src/{components → themes/theme-one/components}/field.css +494 -494
  24. package/src/{components → themes/theme-one/components}/icon-button.css +40 -40
  25. package/src/{components → themes/theme-one/components}/link.css +21 -21
  26. package/src/{components → themes/theme-one/components}/list.css +317 -317
  27. package/src/{components → themes/theme-one/components}/progress.css +83 -83
  28. package/src/{components → themes/theme-one/components}/range.css +121 -121
  29. package/src/{components → themes/theme-one/components}/rich-text.css +210 -210
  30. package/src/{components → themes/theme-one/components}/select.css +163 -163
  31. package/src/{components → themes/theme-one/components}/snackbar.css +148 -148
  32. package/src/{components → themes/theme-one/components}/spinner.css +38 -38
  33. package/src/{components → themes/theme-one/components}/switch.css +189 -189
  34. package/src/{components → themes/theme-one/components}/tab-buttons.css +120 -120
  35. package/src/themes/theme-one/components/table.css +100 -0
  36. package/src/{components → themes/theme-one/components}/text-field.css +57 -57
  37. package/src/{components → themes/theme-one/components}/textarea.css +25 -25
  38. package/src/{components → themes/theme-one/components}/toggle-button-group.css +135 -139
  39. package/src/{components → themes/theme-one/components}/tooltip.css +94 -94
  40. package/src/{components → themes/theme-one/components}/typography.css +209 -209
  41. package/src/themes/theme-one/components.css +37 -0
  42. package/src/themes/theme-one/imports.css +16 -0
  43. package/src/{theme.css → themes/theme-one/theme.css} +163 -163
  44. package/src/themes/theme-two/components/accordion.css +172 -0
  45. package/src/themes/theme-two/components/alert.css +85 -0
  46. package/src/themes/theme-two/components/avatar.css +68 -0
  47. package/src/themes/theme-two/components/badge.css +101 -0
  48. package/src/themes/theme-two/components/button-group.css +50 -0
  49. package/src/themes/theme-two/components/button.css +217 -0
  50. package/src/themes/theme-two/components/card.css +82 -0
  51. package/src/themes/theme-two/components/checkbox-radio.css +123 -0
  52. package/src/themes/theme-two/components/chip.css +135 -0
  53. package/src/themes/theme-two/components/definition-list.css +65 -0
  54. package/src/themes/theme-two/components/dialog.css +59 -0
  55. package/src/themes/theme-two/components/divider.css +7 -0
  56. package/src/themes/theme-two/components/field-group.css +83 -0
  57. package/src/themes/theme-two/components/field.css +281 -0
  58. package/src/themes/theme-two/components/icon-button.css +40 -0
  59. package/src/themes/theme-two/components/link.css +21 -0
  60. package/src/themes/theme-two/components/list.css +317 -0
  61. package/src/themes/theme-two/components/progress.css +83 -0
  62. package/src/themes/theme-two/components/range.css +121 -0
  63. package/src/themes/theme-two/components/rich-text.css +210 -0
  64. package/src/themes/theme-two/components/select.css +162 -0
  65. package/src/themes/theme-two/components/snackbar.css +148 -0
  66. package/src/themes/theme-two/components/spinner.css +38 -0
  67. package/src/themes/theme-two/components/switch.css +189 -0
  68. package/src/themes/theme-two/components/tab-buttons.css +120 -0
  69. package/src/{components → themes/theme-two/components}/table.css +107 -107
  70. package/src/themes/theme-two/components/text-field.css +57 -0
  71. package/src/themes/theme-two/components/textarea.css +25 -0
  72. package/src/themes/theme-two/components/toggle-button-group.css +135 -0
  73. package/src/themes/theme-two/components/tooltip.css +94 -0
  74. package/src/themes/theme-two/components/typography.css +209 -0
  75. package/src/themes/theme-two/components.css +37 -0
  76. package/src/themes/theme-two/imports.css +16 -0
  77. package/src/themes/theme-two/theme.css +158 -0
  78. package/src/core/components.css +0 -37
  79. package/src/main.css +0 -13
  80. package/src/opui.css +0 -10
@@ -0,0 +1,209 @@
1
+ @layer components.root {
2
+ /* Base typography */
3
+ :where(h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6) {
4
+ color: var(--text-color-1);
5
+ font-weight: 700;
6
+ text-wrap: pretty;
7
+ }
8
+
9
+ :where(h1, .h1) {
10
+ font-size: var(--font-size-h1, var(--font-size-7));
11
+ letter-spacing: -0.02em;
12
+ line-height: 1.15;
13
+ }
14
+
15
+ :where(h2, .h2) {
16
+ font-size: var(--font-size-h2, var(--font-size-5, 2rem));
17
+ letter-spacing: -0.02em;
18
+ line-height: 1.2;
19
+ }
20
+
21
+ :where(h3, .h3) {
22
+ font-size: var(--font-size-h3, var(--font-size-4, 1.5rem));
23
+ letter-spacing: -0.01em;
24
+ line-height: 1.167;
25
+ }
26
+
27
+ :where(h4, .h4) {
28
+ font-size: var(--font-size-h4, var(--font-size-3, 1.25rem));
29
+ letter-spacing: -0.01em;
30
+ line-height: 1.235;
31
+ }
32
+
33
+ :where(h5, .h5) {
34
+ font-size: var(--font-size-h5, var(--font-size-2, 1.1rem));
35
+ line-height: 1.334;
36
+ }
37
+
38
+ :where(h6, .h6) {
39
+ font-size: var(--font-size-h6, var(--font-size-1, 1rem));
40
+ line-height: 1;
41
+ }
42
+
43
+ :where(hgroup) {
44
+ & > :where(p, .p) {
45
+ margin: 0;
46
+ }
47
+
48
+ & > :where(h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6) {
49
+ margin-block-end: 0.4em;
50
+ }
51
+
52
+ /* The second p element */
53
+ & > :where(p, .p):last-of-type:last-child:not(:first-child) {
54
+ color: oklch(from currentColor l c h / 75%);
55
+ font-size: var(--font-size-lg);
56
+ line-height: 1.6;
57
+ }
58
+ }
59
+
60
+ /** Overline */
61
+ :where(.overline, hgroup > :where(p, .p):first-of-type:first-child) {
62
+ color: light-dark(
63
+ oklch(from var(--text-color-2) calc(l * 1.25) c h),
64
+ oklch(from var(--text-color-2) calc(l * 0.75) c h)
65
+ );
66
+ font-size: var(--font-size-xs);
67
+ font-weight: 500;
68
+ letter-spacing: 0.06em;
69
+ line-height: 2.5;
70
+ text-transform: uppercase;
71
+ }
72
+
73
+ :where(p, .p) {
74
+ text-wrap: pretty;
75
+
76
+ &.small {
77
+ font-size: var(--font-size-md);
78
+ }
79
+ &.large {
80
+ font-size: var(--font-size-lg);
81
+ }
82
+ }
83
+
84
+ /* Inline text elements */
85
+ :where(ins, u, abbr, dfn) {
86
+ text-decoration: underline;
87
+ text-underline-offset: 1px;
88
+
89
+ @supports (-moz-appearance: none) {
90
+ text-underline-offset: 2px;
91
+ }
92
+ }
93
+
94
+ :where(abbr, dfn) {
95
+ font-style: normal;
96
+ text-decoration: var(--color-9) underline dotted;
97
+
98
+ &[title] {
99
+ cursor: help;
100
+ text-underline-offset: 1px;
101
+ }
102
+
103
+ @supports (-moz-appearance: none) {
104
+ text-underline-offset: 2px;
105
+ }
106
+ }
107
+
108
+ :where(sup) {
109
+ font-size: 0.5em;
110
+ }
111
+
112
+ :where(del, ins) {
113
+ color: var(--color-9);
114
+ }
115
+
116
+ :where(small) {
117
+ font-size: max(0.5em, var(--font-size-0, 0.75rem));
118
+ max-inline-size: var(--size-content-1);
119
+ }
120
+
121
+ :where(cite) {
122
+ font-style: italic;
123
+ }
124
+
125
+ /* Blockquote */
126
+ :where(blockquote) {
127
+ border-inline-start-width: var(--border-size-3);
128
+ display: grid;
129
+ gap: var(--size-3);
130
+ padding-block: var(--size-3);
131
+ padding-inline: var(--size-4);
132
+
133
+ :first-child {
134
+ margin-block-start: 0;
135
+ }
136
+
137
+ :last-child {
138
+ margin-block-end: 0;
139
+ }
140
+
141
+ footer {
142
+ color: var(--text-color-2);
143
+ }
144
+ }
145
+
146
+ /* Code */
147
+ :where(pre) {
148
+ border-radius: 0.375rem;
149
+ direction: ltr;
150
+ font-size: 0.875rem;
151
+ line-height: 1.7142857;
152
+ margin-block: 1.7142857em;
153
+ max-inline-size: max-content;
154
+ min-inline-size: 0;
155
+ padding-block: 0.8571429em;
156
+ padding-inline: 1.1428571em;
157
+ white-space: pre;
158
+ writing-mode: lr;
159
+ }
160
+
161
+ :where(code, kbd, samp, pre) {
162
+ font-family: var(--font-mono);
163
+ }
164
+
165
+ :where(code) {
166
+ background-color: oklch(00 0 0 /18%);
167
+ border-radius: var(--border-size-3);
168
+ font-size: 0.9em;
169
+ padding: 0.2ex 0.5ex;
170
+ }
171
+
172
+ :where(kbd, var) {
173
+ background-color: var(--text-color-2);
174
+ border-color: var(--text-color-2);
175
+ border-radius: var(--border-radius, var(--radius-2));
176
+ border-width: var(--border-size-1);
177
+ color: var(--text-color-2-contrast);
178
+ padding: calc(var(--size-1) / 2) var(--size-1);
179
+ }
180
+
181
+ :where(:not(pre) code, kbd) {
182
+ word-break: break-word;
183
+ }
184
+
185
+ :where(:not(pre) code) {
186
+ border-radius: var(--border-radius, var(--radius-2));
187
+ padding: var(--size-1) var(--size-2);
188
+ writing-mode: lr;
189
+ }
190
+
191
+ :where(mark) {
192
+ border-radius: var(--border-radius, 0);
193
+ box-decoration-break: clone;
194
+ padding: calc(var(--size-1) / 2) var(--size-1);
195
+ vertical-align: baseline;
196
+ }
197
+
198
+ /* Misc */
199
+ :where(dt) {
200
+ font-weight: 700;
201
+ }
202
+
203
+ :where(figure) {
204
+ & > :where(figcaption) {
205
+ font-size: var(--font-size-1, 1rem);
206
+ text-wrap: balance;
207
+ }
208
+ }
209
+ }
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Components are divided into two categories - if they are stand-alone (root) or if they are built on top of others (extended).
3
+ */
4
+
5
+ /*** Root components (no dependencies) */
6
+ @import "./components/button.css";
7
+ @import "./components/icon-button.css";
8
+ @import "./components/tab-buttons.css";
9
+ @import "./components/toggle-button-group.css";
10
+ @import "./components/avatar.css";
11
+ @import "./components/badge.css";
12
+ @import "./components/card.css";
13
+ @import "./components/chip.css";
14
+ @import "./components/definition-list.css";
15
+ @import "./components/divider.css";
16
+ @import "./components/link.css";
17
+ @import "./components/table.css";
18
+ @import "./components/progress.css";
19
+ @import "./components/spinner.css";
20
+ @import "./components/checkbox-radio.css";
21
+ @import "./components/switch.css";
22
+ @import "./components/range.css";
23
+ @import "./components/typography.css";
24
+
25
+ /*** Extended components (has dependencies) */
26
+ @import "./components/button-group.css";
27
+ @import "./components/accordion.css";
28
+ @import "./components/list.css";
29
+ @import "./components/alert.css";
30
+ @import "./components/dialog.css";
31
+ @import "./components/snackbar.css";
32
+ @import "./components/field-group.css";
33
+ @import "./components/field.css";
34
+ @import "./components/select.css";
35
+ @import "./components/text-field.css";
36
+ @import "./components/textarea.css";
37
+ @import "./components/rich-text.css";
@@ -0,0 +1,16 @@
1
+ @layer openprops, normalize, theme, components.root, components.extended, utils;
2
+
3
+ /* Open Props */
4
+ @import "../../open-props.css";
5
+
6
+ /* Normalize */
7
+ @import "../../core/normalize.css";
8
+
9
+ /* Theme */
10
+ @import "./theme.css";
11
+
12
+ /* Components */
13
+ @import "./components.css";
14
+
15
+ /* Utils */
16
+ @import "../../core/utils.css";
@@ -0,0 +1,158 @@
1
+ /*
2
+ theme two theme setup
3
+ */
4
+ @layer theme {
5
+ .light {
6
+ --color-scheme: light;
7
+ }
8
+ .dark {
9
+ --color-scheme: dark;
10
+ }
11
+
12
+ :where(html) {
13
+ color-scheme: var(--color-scheme, light dark);
14
+
15
+ --palette-hue: var(--oklch-orange);
16
+ --palette-hue-rotate-by: 0;
17
+ --palette-chroma: 0.89;
18
+
19
+ /* Primary */
20
+ --primary: var(--color-8);
21
+ --primary-light: oklch(from var(--primary) calc(l * 1.25) c h);
22
+ --primary-dark: oklch(from var(--primary) calc(l * 0.75) c h);
23
+ --primary-contrast: var(--gray-1);
24
+
25
+ /* Text */
26
+ --text-color-1: light-dark(var(--gray-15), var(--gray-1));
27
+ --text-color-1-contrast: light-dark(var(--gray-2), var(--gray-15));
28
+ --text-color-2: light-dark(var(--gray-13), var(--gray-4));
29
+ --text-color-2-contrast: light-dark(var(--gray-4), var(--gray-13));
30
+
31
+ /* Surface */
32
+ --surface-default: light-dark(var(--gray-1), var(--gray-13));
33
+ --surface-filled: light-dark(var(--gray-3), var(--gray-15));
34
+ --surface-tonal: light-dark(var(--gray-3), var(--gray-12));
35
+ --surface-elevated: light-dark(var(--gray-1), var(--gray-12));
36
+
37
+ /* Shadows */
38
+ --shadow-color: light-dark(220 3% 15%, 220 40% 2%);
39
+ --shadow-strength: light-dark(1%, 10%);
40
+ --inner-shadow-highlight: light-dark(
41
+ inset 0 -0.5px 0 0 #fff,
42
+ inset 0 0.5px 0 0 #0001,
43
+ inset 0 -0.5px 0 0 #fff1,
44
+ inset 0 0.5px 0 0 #0007
45
+ );
46
+
47
+ /* Typography */
48
+ --font-size-h1: var(--font-size-fluid-3, 3.5rem);
49
+ --font-size-h2: var(--font-size-fluid-2, 2rem);
50
+ --font-size-h3: var(--font-size-fluid-1, 1.5rem);
51
+ --font-size-h4: var(--font-size-3, 1.25rem);
52
+ --font-size-h5: var(--font-size-2, 1.1rem);
53
+ --font-size-h6: var(--font-size-fluid-0, 1rem);
54
+ --font-size-lg: var(--font-size-3, 1.25rem);
55
+ --font-size-md: var(--font-size-fluid-0, 1rem);
56
+ --font-size-sm: 0.875rem;
57
+ --font-size-xs: var(--font-size-0, 0.75rem);
58
+
59
+ /* Borders */
60
+ --border-color: light-dark(var(--gray-4), var(--gray-12));
61
+ --border-radius: var(--size-2);
62
+ --border-width: 1px;
63
+
64
+ /* Input Field */
65
+ --field-border-color: var(--border-color);
66
+ --field-border-radius: var(--size-2);
67
+ --field-border-width: 1px;
68
+ --field-size: 2.3lh;
69
+ --field-size-small: 1.9lh;
70
+
71
+ /* Button */
72
+ --button-border-radius: var(--size-2);
73
+ }
74
+
75
+ /* Highlight colors */
76
+ :where(.red, .error, del) {
77
+ --palette-hue: var(--oklch-red, 25);
78
+ --palette-chroma: 1;
79
+ --palette-hue-rotate-by: 1;
80
+ }
81
+ :where(.blue, .ok, abbr, dfn) {
82
+ --palette-hue: var(--oklch-blue, 210);
83
+ --palette-chroma: 1;
84
+ --palette-hue-rotate-by: 1;
85
+ }
86
+ :where(.green, .good, ins) {
87
+ --palette-hue: var(--oklch-green, 145);
88
+ --palette-chroma: 1;
89
+ --palette-hue-rotate-by: 1;
90
+ }
91
+ :where(.orange, .warning) {
92
+ --palette-hue: var(--oklch-orange, 75);
93
+ --palette-chroma: 1;
94
+ --palette-hue-rotate-by: 1;
95
+ }
96
+
97
+ :where(html) {
98
+ --red: oklch(from var(--color-9) l 0.2 25);
99
+ --blue: oklch(from var(--color-9) l 0.2 210);
100
+ --green: oklch(from var(--color-9) l 0.2 145);
101
+ --orange: oklch(from var(--color-7) l 0.2 75);
102
+ }
103
+
104
+ /* Gray palette */
105
+ :where(html) {
106
+ --gray-chroma: 0.01;
107
+ --gray-lightness: 255;
108
+
109
+ --gray-1: oklch(
110
+ from var(--color-1) l var(--gray-chroma) var(--gray-lightness)
111
+ );
112
+ --gray-2: oklch(
113
+ from var(--color-2) l var(--gray-chroma) var(--gray-lightness)
114
+ );
115
+ --gray-3: oklch(
116
+ from var(--color-3) l var(--gray-chroma) var(--gray-lightness)
117
+ );
118
+ --gray-4: oklch(
119
+ from var(--color-4) l var(--gray-chroma) var(--gray-lightness)
120
+ );
121
+ --gray-5: oklch(
122
+ from var(--color-5) l var(--gray-chroma) var(--gray-lightness)
123
+ );
124
+ --gray-6: oklch(
125
+ from var(--color-6) l var(--gray-chroma) var(--gray-lightness)
126
+ );
127
+ --gray-7: oklch(
128
+ from var(--color-7) l var(--gray-chroma) var(--gray-lightness)
129
+ );
130
+ --gray-8: oklch(
131
+ from var(--color-8) l var(--gray-chroma) var(--gray-lightness)
132
+ );
133
+ --gray-9: oklch(
134
+ from var(--color-9) l var(--gray-chroma) var(--gray-lightness)
135
+ );
136
+ --gray-10: oklch(
137
+ from var(--color-10) l var(--gray-chroma) var(--gray-lightness)
138
+ );
139
+ --gray-11: oklch(
140
+ from var(--color-11) l var(--gray-chroma) var(--gray-lightness)
141
+ );
142
+ --gray-12: oklch(
143
+ from var(--color-12) l var(--gray-chroma) var(--gray-lightness)
144
+ );
145
+ --gray-13: oklch(
146
+ from var(--color-13) l var(--gray-chroma) var(--gray-lightness)
147
+ );
148
+ --gray-14: oklch(
149
+ from var(--color-14) l var(--gray-chroma) var(--gray-lightness)
150
+ );
151
+ --gray-15: oklch(
152
+ from var(--color-15) l var(--gray-chroma) var(--gray-lightness)
153
+ );
154
+ --gray-16: oklch(
155
+ from var(--color-16) l var(--gray-chroma) var(--gray-lightness)
156
+ );
157
+ }
158
+ }
@@ -1,37 +0,0 @@
1
- /*
2
- * Components are divided into two categories - if they are stand-alone (root) or if they are built on top of others (extended).
3
- */
4
-
5
- /*** Root components (no dependencies) */
6
- @import "../components/button.css";
7
- @import "../components/icon-button.css";
8
- @import "../components/tab-buttons.css";
9
- @import "../components/toggle-button-group.css";
10
- @import "../components/avatar.css";
11
- @import "../components/badge.css";
12
- @import "../components/card.css";
13
- @import "../components/chip.css";
14
- @import "../components/definition-list.css";
15
- @import "../components/divider.css";
16
- @import "../components/link.css";
17
- @import "../components/table.css";
18
- @import "../components/progress.css";
19
- @import "../components/spinner.css";
20
- @import "../components/checkbox-radio.css";
21
- @import "../components/switch.css";
22
- @import "../components/range.css";
23
- @import "../components/typography.css";
24
-
25
- /*** Extended components (has dependencies) */
26
- @import "../components/button-group.css";
27
- @import "../components/accordion.css";
28
- @import "../components/list.css";
29
- @import "../components/alert.css";
30
- @import "../components/dialog.css";
31
- @import "../components/snackbar.css";
32
- @import "../components/field-group.css";
33
- @import "../components/field.css";
34
- @import "../components/select.css";
35
- @import "../components/text-field.css";
36
- @import "../components/textarea.css";
37
- @import "../components/rich-text.css";
package/src/main.css DELETED
@@ -1,13 +0,0 @@
1
- /*
2
- This main.css file represents whatever file you choose to use as an entry point for OPUI
3
- Ideally it's the root/entry CSS file in your project.
4
- */
5
-
6
- /* Open Props imports */
7
- @import "./open-props.css";
8
-
9
- /* OPUI Core */
10
- @import "./opui.css";
11
-
12
- /* Theme (example) */
13
- /* @import "./theme.css"; */
package/src/opui.css DELETED
@@ -1,10 +0,0 @@
1
- @layer openprops, normalize, utils, theme, components.root, components.extended;
2
-
3
- /* Normalize */
4
- @import "./core/normalize.css";
5
-
6
- /* Utils */
7
- @import "./core/utils.css";
8
-
9
- /* Components */
10
- @import "./core/components.css";