opui-css 1.2.7 → 2.0.1

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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Felix
3
+ Copyright (c) 2024 Felix Bohlin
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,25 +1,32 @@
1
- # Open Props UI
2
-
3
- A CSS UI library exploring how next-gen HTML & CSS features can change the way we create components. Designed to be used by professional teams as well as tinkering hobbyists. Everything is made with **ease-of-use** and **scalability** in mind. Last but not least - you **copy and paste** the components into your repo. It's the best way to have a complete **understanding** and **ownership** over your stuff.
4
-
5
- https://open-props-ui.netlify.app/
6
-
7
- ## Getting started
8
-
9
- Check out the [getting started guide](https://open-props-ui.netlify.app/guide/getting-started.html).
10
-
11
- ## Backstory
12
-
13
- Practically all established UI libraries need to take older browser versions into account. Some have only just dropped Internet Explorer. Some have barely discovered the power of CSS grid. Open Props UI starts from a blank slate and re-imagines how a component library could be built if you used the most modern features.
14
-
15
- ## The goal of the component library
16
-
17
- > "If you only use the latest features, that means this is can never enter production"
18
-
19
- Yes and no. Right now that's true for most components. The point is to let the spec and the components mature alongside each other and in time the library will be ready for production.
20
-
21
- - Have sensible defaults without sacrificing flexibility and control
22
- - Use modern HTML & CSS features
23
- - Follow accessibility guidelines
24
- - Serve as an inspiration
25
- - Be scalable
1
+ # Open Props UI
2
+
3
+ A CSS UI library exploring how next-gen HTML & CSS features can change the way we create components. Designed to be used by professional teams as well as tinkering hobbyists. Everything is made with **ease-of-use** and **scalability** in mind. Last but not least - you **copy and paste** the components into your repo. It's the best way to have a complete **understanding** and **ownership** over your stuff.
4
+
5
+ https://open-props-ui.netlify.app/
6
+
7
+ ## Getting started
8
+
9
+ Check out the [getting started guide](https://open-props-ui.netlify.app/guide/getting-started.html).
10
+
11
+ ## Development
12
+
13
+ ```
14
+ pnpm i
15
+ pnpm dev:css
16
+ ```
17
+
18
+ ## Backstory
19
+
20
+ Practically all established UI libraries need to take older browser versions into account. Some have only just dropped Internet Explorer. Some have barely discovered the power of CSS grid. Open Props UI starts from a blank slate and re-imagines how a component library could be built if you used the most modern features.
21
+
22
+ ## The goal of the component library
23
+
24
+ > "If you only use the latest features, that means this is can never enter production"
25
+
26
+ Yes and no. Right now that's true for most components. The point is to let the spec and the components mature alongside each other and in time the library will be ready for production.
27
+
28
+ - Have sensible defaults without sacrificing flexibility and control
29
+ - Use modern HTML & CSS features
30
+ - Follow accessibility guidelines
31
+ - Serve as an inspiration
32
+ - Be scalable
package/dist/op+ui.css CHANGED
@@ -503,8 +503,8 @@ When you visibly want to hide an element but make it accessible for screen reade
503
503
  }
504
504
  }
505
505
  /* Components */
506
- /*
507
- * Components are divided into two categories - if they are stand-alone (root) or if they are built on top of others (extended).
506
+ /*
507
+ * Components are divided into two categories - if they are stand-alone (root) or if they are built on top of others (extended).
508
508
  */
509
509
  /*** Root components (no dependencies) */
510
510
  @layer components.root {
@@ -1531,26 +1531,26 @@ When you visibly want to hide an element but make it accessible for screen reade
1531
1531
  margin-block: var(--size-fluid-3);
1532
1532
  }
1533
1533
  }
1534
- @layer components.root {
1535
- :where(.link) {
1536
- color: var(--primary);
1537
- cursor: pointer;
1538
- font-weight: 700;
1539
- text-decoration: underline;
1540
- text-decoration-color: var(--primary);
1541
- text-underline-offset: 2px;
1542
-
1543
- &[href] {
1544
- &:hover,
1545
- &:focus-visible {
1546
- color: var(--primary-light);
1547
- }
1548
- }
1549
-
1550
- @supports (-moz-appearance: none) {
1551
- text-underline-offset: 2px;
1552
- }
1553
- }
1534
+ @layer components.root {
1535
+ :where(.link) {
1536
+ color: var(--primary);
1537
+ cursor: pointer;
1538
+ font-weight: 700;
1539
+ text-decoration: underline;
1540
+ text-decoration-color: var(--primary);
1541
+ text-underline-offset: 2px;
1542
+
1543
+ &[href] {
1544
+ &:hover,
1545
+ &:focus-visible {
1546
+ color: var(--primary-light);
1547
+ }
1548
+ }
1549
+
1550
+ @supports (-moz-appearance: none) {
1551
+ text-underline-offset: 2px;
1552
+ }
1553
+ }
1554
1554
  }
1555
1555
  @layer components.root {
1556
1556
  :where(table) {
package/dist/ui.css CHANGED
@@ -1,7 +1,7 @@
1
- @layer openprops, normalize, utils, theme, components.root, components.extended;
2
-
3
- /* Normalize */
4
-
1
+ @layer openprops, normalize, utils, theme, components.root, components.extended;
2
+
3
+ /* Normalize */
4
+
5
5
  @layer normalize {
6
6
  *,
7
7
  ::before,
@@ -195,10 +195,10 @@
195
195
  :target {
196
196
  scroll-margin-block-start: 2rem;
197
197
  }
198
- }
199
-
200
- /* Utils */
201
-
198
+ }
199
+
200
+ /* Utils */
201
+
202
202
  @layer utils {
203
203
  /*
204
204
  Screen-reader only
@@ -258,10 +258,10 @@ When you visibly want to hide an element but make it accessible for screen reade
258
258
  }
259
259
  }
260
260
  }
261
- }
262
-
263
- /* Theme */
264
-
261
+ }
262
+
263
+ /* Theme */
264
+
265
265
  @layer theme {
266
266
  .light {
267
267
  --color-scheme: light;
@@ -421,16 +421,16 @@ When you visibly want to hide an element but make it accessible for screen reade
421
421
  from var(--color-16) l var(--gray-chroma) var(--gray-lightness)
422
422
  );
423
423
  }
424
- }
425
-
426
- /* Components */
427
-
428
- /*
429
- * Components are divided into two categories - if they are stand-alone (root) or if they are built on top of others (extended).
430
- */
431
-
432
- /*** Root components (no dependencies) */
433
-
424
+ }
425
+
426
+ /* Components */
427
+
428
+ /*
429
+ * Components are divided into two categories - if they are stand-alone (root) or if they are built on top of others (extended).
430
+ */
431
+
432
+ /*** Root components (no dependencies) */
433
+
434
434
  @layer components.root {
435
435
  :where(.button) {
436
436
  --_bg-color: transparent;
@@ -697,8 +697,8 @@ When you visibly want to hide an element but make it accessible for screen reade
697
697
  cursor: pointer;
698
698
  margin-inline-end: var(--size-relative-6);
699
699
  }
700
- }
701
-
700
+ }
701
+
702
702
  @layer components.root {
703
703
  :where(.icon-button) {
704
704
  --_text-color: inherit;
@@ -738,8 +738,8 @@ When you visibly want to hide an element but make it accessible for screen reade
738
738
  }
739
739
  }
740
740
  }
741
- }
742
-
741
+ }
742
+
743
743
  @layer components.root {
744
744
  :where(nav.tabs) {
745
745
  --_bg-color: transparent;
@@ -859,8 +859,8 @@ When you visibly want to hide an element but make it accessible for screen reade
859
859
  }
860
860
  }
861
861
  }
862
- }
863
-
862
+ }
863
+
864
864
  @layer components.root {
865
865
  :where([role="group"].toggle-button-group) {
866
866
  --_border-radius: var(--radius-round);
@@ -999,8 +999,8 @@ When you visibly want to hide an element but make it accessible for screen reade
999
999
  }
1000
1000
  }
1001
1001
  }
1002
- }
1003
-
1002
+ }
1003
+
1004
1004
  @layer components.root {
1005
1005
  :where(.avatar) {
1006
1006
  --_bg-color: var(--color-8);
@@ -1068,8 +1068,8 @@ When you visibly want to hide an element but make it accessible for screen reade
1068
1068
  outline: 2px solid var(--surface-default);
1069
1069
  }
1070
1070
  }
1071
- }
1072
-
1071
+ }
1072
+
1073
1073
  @layer components.root {
1074
1074
  :where(.badge) {
1075
1075
  --_bg-color: var(--primary);
@@ -1170,8 +1170,8 @@ When you visibly want to hide an element but make it accessible for screen reade
1170
1170
  }
1171
1171
  }
1172
1172
  }
1173
- }
1174
-
1173
+ }
1174
+
1175
1175
  @layer components.root {
1176
1176
  :where(.card) {
1177
1177
  --_bg-color: transparent;
@@ -1253,8 +1253,8 @@ When you visibly want to hide an element but make it accessible for screen reade
1253
1253
  padding-inline: var(--size-1) var(--size-3);
1254
1254
  }
1255
1255
  }
1256
- }
1257
-
1256
+ }
1257
+
1258
1258
  @layer components.root {
1259
1259
  :where(.chip) {
1260
1260
  --_bg-color: var(--surface-tonal);
@@ -1389,8 +1389,8 @@ When you visibly want to hide an element but make it accessible for screen reade
1389
1389
  cursor: not-allowed;
1390
1390
  }
1391
1391
  }
1392
- }
1393
-
1392
+ }
1393
+
1394
1394
  @layer components.root {
1395
1395
  :where(.definition-list) {
1396
1396
  --_border-style: solid;
@@ -1455,38 +1455,38 @@ When you visibly want to hide an element but make it accessible for screen reade
1455
1455
  }
1456
1456
  }
1457
1457
  }
1458
- }
1459
-
1458
+ }
1459
+
1460
1460
  @layer components.root {
1461
1461
  :where(hr) {
1462
1462
  background-color: var(--border-color);
1463
1463
  block-size: var(--border-size-1);
1464
1464
  margin-block: var(--size-fluid-3);
1465
1465
  }
1466
- }
1467
-
1468
- @layer components.root {
1469
- :where(.link) {
1470
- color: var(--primary);
1471
- cursor: pointer;
1472
- font-weight: 700;
1473
- text-decoration: underline;
1474
- text-decoration-color: var(--primary);
1475
- text-underline-offset: 2px;
1476
-
1477
- &[href] {
1478
- &:hover,
1479
- &:focus-visible {
1480
- color: var(--primary-light);
1481
- }
1482
- }
1483
-
1484
- @supports (-moz-appearance: none) {
1485
- text-underline-offset: 2px;
1486
- }
1487
- }
1488
- }
1489
-
1466
+ }
1467
+
1468
+ @layer components.root {
1469
+ :where(.link) {
1470
+ color: var(--primary);
1471
+ cursor: pointer;
1472
+ font-weight: 700;
1473
+ text-decoration: underline;
1474
+ text-decoration-color: var(--primary);
1475
+ text-underline-offset: 2px;
1476
+
1477
+ &[href] {
1478
+ &:hover,
1479
+ &:focus-visible {
1480
+ color: var(--primary-light);
1481
+ }
1482
+ }
1483
+
1484
+ @supports (-moz-appearance: none) {
1485
+ text-underline-offset: 2px;
1486
+ }
1487
+ }
1488
+ }
1489
+
1490
1490
  @layer components.root {
1491
1491
  :where(table) {
1492
1492
  border-collapse: collapse;
@@ -1593,8 +1593,8 @@ When you visibly want to hide an element but make it accessible for screen reade
1593
1593
  }
1594
1594
  }
1595
1595
  }
1596
- }
1597
-
1596
+ }
1597
+
1598
1598
  @layer components.root {
1599
1599
  :where(progress) {
1600
1600
  --_accent-color: var(--primary);
@@ -1677,8 +1677,8 @@ When you visibly want to hide an element but make it accessible for screen reade
1677
1677
  right: -8%;
1678
1678
  }
1679
1679
  }
1680
- }
1681
-
1680
+ }
1681
+
1682
1682
  @layer components.root {
1683
1683
  [aria-busy="true"]:not(
1684
1684
  input,
@@ -1716,8 +1716,8 @@ When you visibly want to hide an element but make it accessible for screen reade
1716
1716
  transform: rotate(1turn);
1717
1717
  }
1718
1718
  }
1719
- }
1720
-
1719
+ }
1720
+
1721
1721
  @layer components.root {
1722
1722
  label:where(.checkbox, .radio) {
1723
1723
  align-items: center;
@@ -1840,8 +1840,8 @@ When you visibly want to hide an element but make it accessible for screen reade
1840
1840
  }
1841
1841
  }
1842
1842
  }
1843
- }
1844
-
1843
+ }
1844
+
1845
1845
  @layer components.root {
1846
1846
  :where(.switch) {
1847
1847
  --_accent-color: var(--primary);
@@ -2030,8 +2030,8 @@ When you visibly want to hide an element but make it accessible for screen reade
2030
2030
  }
2031
2031
  }
2032
2032
  }
2033
- }
2034
-
2033
+ }
2034
+
2035
2035
  @layer components.root {
2036
2036
  :where(.range > input[type="range"]) {
2037
2037
  --thumb-bg: var(--primary);
@@ -2152,8 +2152,8 @@ When you visibly want to hide an element but make it accessible for screen reade
2152
2152
  }
2153
2153
  }
2154
2154
  }
2155
- }
2156
-
2155
+ }
2156
+
2157
2157
  @layer components.root {
2158
2158
  /* Base typography */
2159
2159
  :where(h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6) {
@@ -2362,10 +2362,10 @@ When you visibly want to hide an element but make it accessible for screen reade
2362
2362
  text-wrap: balance;
2363
2363
  }
2364
2364
  }
2365
- }
2366
-
2367
- /*** Extended components (has dependencies) */
2368
-
2365
+ }
2366
+
2367
+ /*** Extended components (has dependencies) */
2368
+
2369
2369
  @layer components.extended {
2370
2370
  :where([role="group"].button-group) {
2371
2371
  --_border-radius: var(--button-border-radius);
@@ -2434,8 +2434,8 @@ When you visibly want to hide an element but make it accessible for screen reade
2434
2434
  }
2435
2435
  }
2436
2436
  }
2437
- }
2438
-
2437
+ }
2438
+
2439
2439
  @layer components.extended {
2440
2440
  :where(details) {
2441
2441
  --_accordion-transition-time: 0.2s;
@@ -2607,8 +2607,8 @@ When you visibly want to hide an element but make it accessible for screen reade
2607
2607
  }
2608
2608
  }
2609
2609
  }
2610
- }
2611
-
2610
+ }
2611
+
2612
2612
  @layer components.extended {
2613
2613
  /*
2614
2614
  Lists meant to be used stand-alone or as part of Select elements
@@ -2925,8 +2925,8 @@ Lists meant to be used stand-alone or as part of Select elements
2925
2925
  }
2926
2926
  }
2927
2927
  }
2928
- }
2929
-
2928
+ }
2929
+
2930
2930
  @layer components.extended {
2931
2931
  :where(.alert) {
2932
2932
  --_bg-color: var(--surface-tonal);
@@ -3011,8 +3011,8 @@ Lists meant to be used stand-alone or as part of Select elements
3011
3011
  }
3012
3012
  }
3013
3013
  }
3014
- }
3015
-
3014
+ }
3015
+
3016
3016
  @layer components.extended {
3017
3017
  :where(dialog) {
3018
3018
  margin-block-start: 15%; /* vertical alignment */
@@ -3071,8 +3071,8 @@ Lists meant to be used stand-alone or as part of Select elements
3071
3071
  :where(html:has(dialog[open])) {
3072
3072
  overflow: hidden;
3073
3073
  }
3074
- }
3075
-
3074
+ }
3075
+
3076
3076
  @layer components.extended {
3077
3077
  :where(.snackbar) {
3078
3078
  align-items: center;
@@ -3220,8 +3220,8 @@ Lists meant to be used stand-alone or as part of Select elements
3220
3220
  }
3221
3221
  }
3222
3222
  }
3223
- }
3224
-
3223
+ }
3224
+
3225
3225
  @layer components.extended {
3226
3226
  /* Common styling for checkbox, radio and switch groups */
3227
3227
  :where(fieldset.field-group) {
@@ -3304,8 +3304,8 @@ Lists meant to be used stand-alone or as part of Select elements
3304
3304
  }
3305
3305
  }
3306
3306
  }
3307
- }
3308
-
3307
+ }
3308
+
3309
3309
  @layer components.extended {
3310
3310
  /*
3311
3311
  - Common styling for input, textarea and select
@@ -3799,8 +3799,8 @@ Lists meant to be used stand-alone or as part of Select elements
3799
3799
  }
3800
3800
  }
3801
3801
  }
3802
- }
3803
-
3802
+ }
3803
+
3804
3804
  @layer components.extended {
3805
3805
  :where(.field > select) {
3806
3806
  position: relative;
@@ -3963,8 +3963,8 @@ Lists meant to be used stand-alone or as part of Select elements
3963
3963
  ::picker(select) {
3964
3964
  appearance: base-select;
3965
3965
  }
3966
- }
3967
-
3966
+ }
3967
+
3968
3968
  @layer components.extended {
3969
3969
  :where(
3970
3970
  .field:has(
@@ -4021,8 +4021,8 @@ Lists meant to be used stand-alone or as part of Select elements
4021
4021
  translate: 0 -50%;
4022
4022
  }
4023
4023
  }
4024
- }
4025
-
4024
+ }
4025
+
4026
4026
  @layer components.extended {
4027
4027
  :where(.field:has(textarea)) {
4028
4028
  textarea {
@@ -4047,8 +4047,8 @@ Lists meant to be used stand-alone or as part of Select elements
4047
4047
  }
4048
4048
  }
4049
4049
  }
4050
- }
4051
-
4050
+ }
4051
+
4052
4052
  @layer components.extended {
4053
4053
  @scope (.rich-text) to (.not-rich-text) {
4054
4054
  a {
@@ -4258,4 +4258,4 @@ Lists meant to be used stand-alone or as part of Select elements
4258
4258
  }
4259
4259
  }
4260
4260
  }
4261
- }
4261
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opui-css",
3
- "version": "1.2.7",
3
+ "version": "2.0.1",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "files": [
@@ -1,21 +1,21 @@
1
- @layer components.root {
2
- :where(.link) {
3
- color: var(--primary);
4
- cursor: pointer;
5
- font-weight: 700;
6
- text-decoration: underline;
7
- text-decoration-color: var(--primary);
8
- text-underline-offset: 2px;
9
-
10
- &[href] {
11
- &:hover,
12
- &:focus-visible {
13
- color: var(--primary-light);
14
- }
15
- }
16
-
17
- @supports (-moz-appearance: none) {
18
- text-underline-offset: 2px;
19
- }
20
- }
21
- }
1
+ @layer components.root {
2
+ :where(.link) {
3
+ color: var(--primary);
4
+ cursor: pointer;
5
+ font-weight: 700;
6
+ text-decoration: underline;
7
+ text-decoration-color: var(--primary);
8
+ text-underline-offset: 2px;
9
+
10
+ &[href] {
11
+ &:hover,
12
+ &:focus-visible {
13
+ color: var(--primary-light);
14
+ }
15
+ }
16
+
17
+ @supports (-moz-appearance: none) {
18
+ text-underline-offset: 2px;
19
+ }
20
+ }
21
+ }
@@ -1,37 +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";
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/opui.css CHANGED
@@ -1,13 +1,13 @@
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
- /* Theme */
10
- @import "./core/theme.css";
11
-
12
- /* Components */
13
- @import "./core/components.css";
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
+ /* Theme */
10
+ @import "./core/theme.css";
11
+
12
+ /* Components */
13
+ @import "./core/components.css";