@semanticus/semanticus-css 1.1.0 → 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 (33) hide show
  1. package/README.md +19 -16
  2. package/dist/semanticus-no-utilities.css +16 -1
  3. package/dist/semanticus-semantics.css +1 -1
  4. package/dist/semanticus-utilities.css +1 -1
  5. package/dist/semanticus.css +17 -2
  6. package/package.json +3 -1
  7. package/src/components/_card.css +65 -4
  8. package/src/components/_content-grid.css +95 -0
  9. package/src/{semantics/attributes/_role-toolbar.css → components/_grid.css} +1 -1
  10. package/src/components/_icons.css +2 -3
  11. package/src/components/modules.css +2 -1
  12. package/src/index.css +1 -1
  13. package/src/semantics/attributes/_popover.css +0 -4
  14. package/src/semantics/attributes/_role-group.css +126 -0
  15. package/src/semantics/attributes/_role-search.css +14 -0
  16. package/src/semantics/attributes/_role-status-alert.css +36 -2
  17. package/src/semantics/elements/_details.css +0 -1
  18. package/src/semantics/elements/_nav.css +5 -1
  19. package/src/semantics/modules.css +2 -2
  20. package/src/utilities/effects/_shadows.css +4 -0
  21. package/src/variables/_theme.css +1 -1
  22. package/src/variants/intent/_contrast.css +15 -20
  23. package/src/variants/intent/_danger.css +14 -19
  24. package/src/variants/intent/_info.css +14 -19
  25. package/src/variants/intent/_primary.css +14 -19
  26. package/src/variants/intent/_secondary.css +14 -19
  27. package/src/variants/intent/_success.css +14 -19
  28. package/src/variants/intent/_warning.css +14 -19
  29. package/src/variants/modifiers/_ghost.css +2 -2
  30. package/src/variants/modifiers/_striped.css +8 -8
  31. package/src/variants/modifiers/_subtle.css +2 -2
  32. package/src/components/_pane.css +0 -19
  33. package/src/semantics/attributes/_role-group-search.css +0 -137
@@ -1,6 +1,16 @@
1
- :where(a:not([role="button"])),
2
- [role="link"] {
3
- &.primary {
1
+ .primary {
2
+ &:not(a:not([role="button"]), [role="link"]) {
3
+ --color-background: oklch(from var(--color-primary-fill) l c h / var(--color-background-opacity));
4
+ --border-color: oklch(from var(--color-primary-fill) l c h / var(--color-border-opacity));
5
+ --color-text: oklch(from var(--color-primary-on-fill) l c h / var(--color-text-opacity));
6
+ --color-text-muted: color-mix(in srgb, var(--color-text), transparent 40%);
7
+
8
+ --dialog-fill: oklch(from var(--color-primary-fill) l c h / var(--color-background-opacity));
9
+ --dialog-border: oklch(from var(--color-primary-fill) l c h / var(--color-background-opacity));
10
+ --dialog-section-fill: color-mix(in srgb, light-dark(var(--color-slate-900), var(--color-slate-50)), transparent 90%);
11
+ }
12
+
13
+ &:is(a:not([role="button"]), [role="link"]) {
4
14
  --color-text: oklch(from var(--color-primary-text) l c h / var(--color-text-opacity));
5
15
  --color-text-muted: color-mix(in srgb, var(--color-text), transparent 40%);
6
16
 
@@ -8,17 +18,8 @@
8
18
  --color-text: oklch(from var(--color-primary-text-hover) l c h / var(--color-text-opacity));
9
19
  }
10
20
  }
11
- }
12
21
 
13
- .primary:not([role="link"], a:not([role="button"])) {
14
- --color-background: oklch(from var(--color-primary-fill) l c h / var(--color-background-opacity));
15
- --border-color: oklch(from var(--color-primary-fill) l c h / var(--color-border-opacity));
16
- --color-text: oklch(from var(--color-primary-on-fill) l c h / var(--color-text-opacity));
17
- --color-text-muted: color-mix(in srgb, var(--color-text), transparent 40%);
18
- }
19
-
20
- :is(button, [type="submit"], [type="button"], [role="button"]):not([role="link"]) {
21
- &.primary {
22
+ &:is(button, [type="submit"], [type="button"], [role="button"]):not([role="link"]) {
22
23
  &:is([aria-current]:not([aria-current="false"]), :hover, :active, :focus) {
23
24
  --color-background: oklch(from var(--color-primary-fill-hover) l c h / var(--color-background-opacity));
24
25
  --border-color: oklch(from var(--color-primary-fill-hover) l c h / var(--color-border-opacity));
@@ -31,9 +32,3 @@
31
32
  }
32
33
  }
33
34
  }
34
-
35
- :is(.card, .pane, [role="status"], [role="alert"]).primary {
36
- --dialog-fill: oklch(from var(--color-primary-fill) l c h / var(--color-background-opacity));
37
- --dialog-border: oklch(from var(--color-primary-fill) l c h / var(--color-background-opacity));
38
- --dialog-section-fill: color-mix(in srgb, light-dark(var(--color-slate-900), var(--color-slate-50)), transparent 90%);
39
- }
@@ -1,6 +1,16 @@
1
- :where(a:not([role="button"])),
2
- [role="link"] {
3
- &.secondary {
1
+ .secondary {
2
+ &:not(a:not([role="button"]), [role="link"]) {
3
+ --color-background: oklch(from var(--color-secondary-fill) l c h / var(--color-background-opacity));
4
+ --border-color: oklch(from var(--color-secondary-fill) l c h / var(--color-border-opacity));
5
+ --color-text: oklch(from var(--color-secondary-on-fill) l c h / var(--color-text-opacity));
6
+ --color-text-muted: color-mix(in srgb, var(--color-text), transparent 40%);
7
+
8
+ --dialog-fill: oklch(from var(--color-secondary-fill) l c h / var(--color-background-opacity));
9
+ --dialog-border: oklch(from var(--color-secondary-fill) l c h / var(--color-background-opacity));
10
+ --dialog-section-fill: color-mix(in srgb, light-dark(var(--color-slate-900), var(--color-slate-50)), transparent 90%);
11
+ }
12
+
13
+ &:is(a:not([role="button"]), [role="link"]) {
4
14
  --color-text: oklch(from var(--color-secondary-text) l c h / var(--color-text-opacity));
5
15
  --color-text-muted: color-mix(in srgb, var(--color-text), transparent 40%);
6
16
 
@@ -8,17 +18,8 @@
8
18
  --color-text: oklch(from var(--color-secondary-text-hover) l c h / var(--color-text-opacity));
9
19
  }
10
20
  }
11
- }
12
21
 
13
- .secondary:not([role="link"], a:not([role="button"])) {
14
- --color-background: oklch(from var(--color-secondary-fill) l c h / var(--color-background-opacity));
15
- --border-color: oklch(from var(--color-secondary-fill) l c h / var(--color-border-opacity));
16
- --color-text: oklch(from var(--color-secondary-on-fill) l c h / var(--color-text-opacity));
17
- --color-text-muted: color-mix(in srgb, var(--color-text), transparent 40%);
18
- }
19
-
20
- :is(button, [type="submit"], [type="button"], [role="button"]):not([role="link"]) {
21
- &.secondary {
22
+ &:is(button, [type="submit"], [type="button"], [role="button"]):not([role="link"]) {
22
23
  &:is([aria-current]:not([aria-current="false"]), :hover, :active, :focus) {
23
24
  --color-background: oklch(from var(--color-secondary-fill-hover) l c h / var(--color-background-opacity));
24
25
  --border-color: oklch(from var(--color-secondary-fill-hover) l c h / var(--color-border-opacity));
@@ -31,9 +32,3 @@
31
32
  }
32
33
  }
33
34
  }
34
-
35
- :is(.card, .pane, [role="status"], [role="alert"]).secondary {
36
- --dialog-fill: oklch(from var(--color-secondary-fill) l c h / var(--color-background-opacity));
37
- --dialog-border: oklch(from var(--color-secondary-fill) l c h / var(--color-background-opacity));
38
- --dialog-section-fill: color-mix(in srgb, light-dark(var(--color-slate-900), var(--color-slate-50)), transparent 90%);
39
- }
@@ -1,6 +1,16 @@
1
- :where(a:not([role="button"])),
2
- [role="link"] {
3
- &.success {
1
+ .success {
2
+ &:not(a:not([role="button"]), [role="link"]) {
3
+ --color-background: oklch(from var(--color-success-fill) l c h / var(--color-background-opacity));
4
+ --border-color: oklch(from var(--color-success-fill) l c h / var(--color-border-opacity));
5
+ --color-text: oklch(from var(--color-success-on-fill) l c h / var(--color-text-opacity));
6
+ --color-text-muted: color-mix(in srgb, var(--color-text), transparent 40%);
7
+
8
+ --dialog-fill: oklch(from var(--color-success-fill) l c h / var(--color-background-opacity));
9
+ --dialog-border: oklch(from var(--color-success-fill) l c h / var(--color-background-opacity));
10
+ --dialog-section-fill: color-mix(in srgb, light-dark(var(--color-slate-900), var(--color-slate-50)), transparent 90%);
11
+ }
12
+
13
+ &:is(a:not([role="button"]), [role="link"]) {
4
14
  --color-text: oklch(from var(--color-success-text) l c h / var(--color-text-opacity));
5
15
  --color-text-muted: color-mix(in srgb, var(--color-text), transparent 40%);
6
16
 
@@ -8,17 +18,8 @@
8
18
  --color-text: oklch(from var(--color-success-text-hover) l c h / var(--color-text-opacity));
9
19
  }
10
20
  }
11
- }
12
21
 
13
- .success:not([role="link"], a:not([role="button"])) {
14
- --color-background: oklch(from var(--color-success-fill) l c h / var(--color-background-opacity));
15
- --border-color: oklch(from var(--color-success-fill) l c h / var(--color-border-opacity));
16
- --color-text: oklch(from var(--color-success-on-fill) l c h / var(--color-text-opacity));
17
- --color-text-muted: color-mix(in srgb, var(--color-text), transparent 40%);
18
- }
19
-
20
- :is(button, [type="submit"], [type="button"], [role="button"]):not([role="link"]) {
21
- &.success {
22
+ &:is(button, [type="submit"], [type="button"], [role="button"]):not([role="link"]) {
22
23
  &:is([aria-current]:not([aria-current="false"]), :hover, :active, :focus) {
23
24
  --color-background: oklch(from var(--color-success-fill-hover) l c h / var(--color-background-opacity));
24
25
  --border-color: oklch(from var(--color-success-fill-hover) l c h / var(--color-border-opacity));
@@ -31,9 +32,3 @@
31
32
  }
32
33
  }
33
34
  }
34
-
35
- :is(.card, .pane, [role="status"], [role="alert"]).success {
36
- --dialog-fill: oklch(from var(--color-success-fill) l c h / var(--color-background-opacity));
37
- --dialog-border: oklch(from var(--color-success-fill) l c h / var(--color-background-opacity));
38
- --dialog-section-fill: color-mix(in srgb, light-dark(var(--color-slate-900), var(--color-slate-50)), transparent 90%);
39
- }
@@ -1,6 +1,16 @@
1
- :where(a:not([role="button"])),
2
- [role="link"] {
3
- &.warning {
1
+ .warning {
2
+ &:not(a:not([role="button"]), [role="link"]) {
3
+ --color-background: oklch(from var(--color-warning-fill) l c h / var(--color-background-opacity));
4
+ --border-color: oklch(from var(--color-warning-fill) l c h / var(--color-border-opacity));
5
+ --color-text: oklch(from var(--color-warning-on-fill) l c h / var(--color-text-opacity));
6
+ --color-text-muted: color-mix(in srgb, var(--color-text), transparent 40%);
7
+
8
+ --dialog-fill: oklch(from var(--color-warning-fill) l c h / var(--color-background-opacity));
9
+ --dialog-border: oklch(from var(--color-warning-fill) l c h / var(--color-background-opacity));
10
+ --dialog-section-fill: color-mix(in srgb, light-dark(var(--color-slate-900), var(--color-slate-50)), transparent 90%);
11
+ }
12
+
13
+ &:is(a:not([role="button"]), [role="link"]) {
4
14
  --color-text: oklch(from var(--color-warning-text) l c h / var(--color-text-opacity));
5
15
  --color-text-muted: color-mix(in srgb, var(--color-text), transparent 40%);
6
16
 
@@ -8,17 +18,8 @@
8
18
  --color-text: oklch(from var(--color-warning-text-hover) l c h / var(--color-text-opacity));
9
19
  }
10
20
  }
11
- }
12
21
 
13
- .warning:not([role="link"], a:not([role="button"])) {
14
- --color-background: oklch(from var(--color-warning-fill) l c h / var(--color-background-opacity));
15
- --border-color: oklch(from var(--color-warning-fill) l c h / var(--color-border-opacity));
16
- --color-text: oklch(from var(--color-warning-on-fill) l c h / var(--color-text-opacity));
17
- --color-text-muted: color-mix(in srgb, var(--color-text), transparent 40%);
18
- }
19
-
20
- :is(button, [type="submit"], [type="button"], [role="button"]):not([role="link"]) {
21
- &.warning {
22
+ &:is(button, [type="submit"], [type="button"], [role="button"]):not([role="link"]) {
22
23
  &:is([aria-current]:not([aria-current="false"]), :hover, :active, :focus) {
23
24
  --color-background: oklch(from var(--color-warning-fill-hover) l c h / var(--color-background-opacity));
24
25
  --border-color: oklch(from var(--color-warning-fill-hover) l c h / var(--color-border-opacity));
@@ -31,9 +32,3 @@
31
32
  }
32
33
  }
33
34
  }
34
-
35
- :is(.card, .pane, [role="status"], [role="alert"]).warning {
36
- --dialog-fill: oklch(from var(--color-warning-fill) l c h / var(--color-background-opacity));
37
- --dialog-border: oklch(from var(--color-warning-fill) l c h / var(--color-background-opacity));
38
- --dialog-section-fill: color-mix(in srgb, light-dark(var(--color-slate-900), var(--color-slate-50)), transparent 90%);
39
- }
@@ -1,10 +1,10 @@
1
1
  .ghost {
2
2
  --color-background: transparent;
3
3
 
4
- background-color: var(--color-background) !important;
4
+ background-color: var(--color-background);
5
5
  }
6
6
 
7
- :is(.card, .pane, [role="status"], [role="alert"], button, [type="submit"], [type="button"], [role="button"]) {
7
+ :not([role="link"], a:not([role="button"])) {
8
8
  &.ghost {
9
9
  &.primary {
10
10
  --color-background: transparent;
@@ -1,11 +1,11 @@
1
- :root,
2
- :host {
3
- --table-row-fill-striped: oklch(from var(--color-zinc-500) l c h / 0.0375);
4
- }
1
+ .striped {
2
+ > :not(table):nth-child(odd) {
3
+ background-color: color-mix(in srgb, var(--color-background), var(--color-hover-effect) 15%);
4
+ }
5
5
 
6
- table.striped tbody tr:nth-child(odd) {
7
- & th,
8
- & td {
9
- background-color: var(--table-row-fill-striped);
6
+ > tbody > tr:nth-child(odd) {
7
+ &:is(th, td) {
8
+ background-color: color-mix(in srgb, var(--color-background), var(--color-hover-effect) 15%);
9
+ }
10
10
  }
11
11
  }
@@ -2,7 +2,7 @@
2
2
  --subtle-opacity: 60%;
3
3
  }
4
4
 
5
- :is(.card, .pane, [role="status"], [role="alert"], button, [type="submit"], [type="button"], [role="button"]) {
5
+ :not([role="link"], a:not([role="button"])) {
6
6
  &.subtle {
7
7
  &.primary {
8
8
  --color-text: oklch(from var(--color-primary-on-fill) l c h / var(--color-text-opacity));
@@ -62,7 +62,7 @@
62
62
  --border-color: oklch(from var(--color-primary-subtle-fill) l c h / var(--color-border-opacity));
63
63
  --color-text-muted: color-mix(in srgb, var(--color-text), transparent 40%);
64
64
 
65
- &:is(.primary, [aria-current]:not([aria-current="false"]), :hover, :active, :focus) {
65
+ &:is([aria-current]:not([aria-current="false"]), :hover, :active, :focus) {
66
66
  --color-text: oklch(from var(--color-primary-on-fill) l c h / var(--color-text-opacity));
67
67
  --color-background: oklch(from var(--color-primary-fill) l c h / var(--color-background-opacity));
68
68
  --border-color: oklch(from var(--color-primary-fill) l c h / var(--color-border-opacity));
@@ -1,19 +0,0 @@
1
- /* Please see src/components/_card.css, since .pane shares most of its styling with .card */
2
-
3
- .pane {
4
- --dialog-shadow: none;
5
- --shadow: none;
6
- --dialog-border: transparent;
7
- --border-color: transparent;
8
- --color-background: light-dark(
9
- color-mix(in srgb, var(--color-slate-50) 25%, white),
10
- color-mix(in srgb, var(--color-slate-50), transparent 95%)
11
- );
12
- --dialog-section-fill: color-mix(in srgb, light-dark(var(--color-slate-900), var(--color-slate-50)), transparent 90%);
13
-
14
- border-radius: 0;
15
-
16
- > :is(header, footer) {
17
- border-radius: 0;
18
- }
19
- }
@@ -1,137 +0,0 @@
1
- [role="search"],
2
- [role="group"] {
3
- border-radius: var(--radius);
4
- box-shadow: var(--group-shadow, 0 0 0 rgba(0, 0, 0, 0));
5
- display: inline-flex;
6
- gap: 0;
7
- margin-bottom: var(--spacing);
8
- position: relative;
9
- transition: box-shadow var(--transition);
10
- vertical-align: middle;
11
- width: 100%;
12
-
13
- & > *:not(details),
14
- & input:not([type="checkbox"], [type="radio"]),
15
- & select {
16
- position: relative;
17
- flex: 1 1 auto;
18
- margin-bottom: 0;
19
-
20
- &:not(:first-child) {
21
- margin-left: calc(var(--border-size) * -1);
22
- border-top-left-radius: 0;
23
- border-bottom-left-radius: 0;
24
- }
25
-
26
- &:not(:last-child) {
27
- border-top-right-radius: 0;
28
- border-bottom-right-radius: 0;
29
- }
30
-
31
- &:focus {
32
- z-index: 2;
33
- }
34
- }
35
-
36
- & button,
37
- & [type="submit"],
38
- & [type="reset"],
39
- & [type="button"],
40
- & [role="button"] {
41
- width: auto;
42
- }
43
-
44
- /* Details dropdown inside group */
45
- & > details {
46
- position: relative;
47
- margin-bottom: 0;
48
- /* Constrain details height to just the button, not the dropdown menu */
49
- height: calc(
50
- 1rem * var(--line-height) + var(--input-spacing-vertical) *
51
- 2 + var(--border-size) * 2
52
- );
53
- overflow: visible;
54
-
55
- &:not(:first-child) {
56
- margin-left: calc(var(--border-size) * -1);
57
-
58
- & > summary {
59
- border-top-left-radius: 0;
60
- border-bottom-left-radius: 0;
61
- }
62
- }
63
-
64
- &:not(:last-child) > summary {
65
- border-top-right-radius: 0;
66
- border-bottom-right-radius: 0;
67
- }
68
-
69
- & > summary:focus {
70
- z-index: 2;
71
- }
72
-
73
- /* Ensure consistent height with other form elements in the group */
74
- & > summary[role="button"] {
75
- display: flex;
76
- align-items: center;
77
- height: 100%;
78
-
79
- &::after {
80
- height: calc(1rem * var(--line-height, 1.5));
81
- }
82
- }
83
- }
84
- }
85
-
86
- @supports selector(:has(*)) {
87
- [role="search"],
88
- [role="group"] {
89
- &:has(
90
- button:focus,
91
- [type="submit"]:focus,
92
- [type="button"]:focus,
93
- [role="button"]:focus
94
- ) {
95
- --group-shadow: var(--group-shadow-focus-button);
96
-
97
- & input:not([type="checkbox"], [type="radio"]),
98
- & select {
99
- border-color: transparent;
100
- }
101
- }
102
-
103
- &:has(input:not([type="submit"], [type="button"]):focus, select:focus) {
104
- --group-shadow: var(--group-shadow-focus-input);
105
-
106
- & button,
107
- & [type="submit"],
108
- & [type="button"],
109
- & [role="button"] {
110
- --button-shadow: 0 0 0 var(--border-size)
111
- var(--color-primary-fill);
112
- --button-shadow-hover: 0 0 0 var(--border-size)
113
- var(--color-primary-fill-hover);
114
- }
115
- }
116
-
117
- & button:focus,
118
- & [type="submit"]:focus,
119
- & [type="reset"]:focus,
120
- & [type="button"]:focus,
121
- & [role="button"]:focus {
122
- box-shadow: none;
123
- }
124
- }
125
- }
126
-
127
- [role="search"] {
128
- & > :first-child {
129
- border-top-left-radius: 5rem;
130
- border-bottom-left-radius: 5rem;
131
- }
132
-
133
- & > :last-child {
134
- border-top-right-radius: 5rem;
135
- border-bottom-right-radius: 5rem;
136
- }
137
- }