@rolemodel/optics 2.1.5 → 2.3.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 (43) hide show
  1. package/.github/pull_request_template.md +18 -9
  2. package/.github/workflows/linting.yml +3 -2
  3. package/.github/workflows/publish-storybook.yml +3 -2
  4. package/.github/workflows/release-package.yml +4 -3
  5. package/.node-version +1 -0
  6. package/.prettierignore +1 -0
  7. package/.stylelintrc.json +3 -2
  8. package/.yarn/install-state.gz +0 -0
  9. package/build_token_json.js +5 -4
  10. package/dist/css/addons/panel.css +3 -3
  11. package/dist/css/addons/tom-select.css +5 -5
  12. package/dist/css/components/accordion.css +3 -3
  13. package/dist/css/components/alert.css +2 -2
  14. package/dist/css/components/avatar.css +6 -6
  15. package/dist/css/components/button.css +3 -3
  16. package/dist/css/components/button_group.css +4 -4
  17. package/dist/css/components/card.css +4 -4
  18. package/dist/css/components/confirm-dialog.css +1 -1
  19. package/dist/css/components/divider.css +7 -6
  20. package/dist/css/components/form.css +15 -15
  21. package/dist/css/components/icon.css +4 -4
  22. package/dist/css/components/index.css +1 -0
  23. package/dist/css/components/modal.css +25 -43
  24. package/dist/css/components/navbar.css +6 -4
  25. package/dist/css/components/pagination.css +1 -1
  26. package/dist/css/components/segmented-control.css +135 -0
  27. package/dist/css/components/side_panel.css +4 -4
  28. package/dist/css/components/sidebar.css +11 -8
  29. package/dist/css/components/spinner.css +3 -3
  30. package/dist/css/components/switch.css +8 -8
  31. package/dist/css/components/table.css +3 -3
  32. package/dist/css/components/tooltip.css +2 -2
  33. package/dist/css/core/base.css +3 -4
  34. package/dist/css/core/layout.css +114 -7
  35. package/dist/css/core/tokens/base_tokens.css +18 -11
  36. package/dist/css/core/utilities.css +93 -68
  37. package/dist/css/optics.css +465 -211
  38. package/dist/css/optics.min.css +1 -1
  39. package/dist/package.json +21 -28
  40. package/dist/tokens/tokens.json +1 -1
  41. package/eslint.config.mjs +27 -0
  42. package/package.json +21 -28
  43. package/.eslintrc.json +0 -14
@@ -1,6 +1,6 @@
1
- ## Task
1
+ # Task
2
2
 
3
- [TR #XXX]()
3
+ [OP-XXX](link to ticket)
4
4
 
5
5
  ## Why?
6
6
 
@@ -15,15 +15,24 @@ What changed in this PR?
15
15
  - [ ] Change 2
16
16
  - [ ] ...
17
17
 
18
- ## Sanity Check
18
+ ## Quality Assurance
19
19
 
20
+ Add an X to all that apply like this: [X]
21
+ Cross out all that don't apply with ~~ ~~ around it like ~~this~~
22
+
23
+ - [ ] Have you tagged the PR with the correct labels?
24
+ - [ ] Have you validated the changes?
25
+ - [ ] Have you run linters? (yarn sanity-check)
26
+ - [ ] Have you run prettier?
27
+ - [ ] Have you tried building the css?
28
+ - [ ] Have you tried building storybook?
20
29
  - [ ] Have you updated any usage of changed tokens?
21
- - [ ] Have you updated the docs with any component changes?
22
- - [ ] Have you updated the dependency graph with any component changes?
23
- - [ ] Have you run linters?
24
- - [ ] Have you run prettier?
25
- - [ ] Have you tried building the css?
26
- - [ ] Have you tried building storybook?
30
+ - [ ] Did you add a component?
31
+ - [ ] Have you added it to the dependency graph?
32
+ - [ ] Have you added it to the docs?
33
+ - [ ] Did you update a component?
34
+ - [ ] Have you updated the dependency graph?
35
+ - [ ] Have you updated the docs?
27
36
  - [ ] Do you need to update the package version?
28
37
 
29
38
  ## Screenshots
@@ -7,7 +7,8 @@ on:
7
7
  branches: ['main']
8
8
  pull_request:
9
9
  branches: ['main']
10
-
10
+ permissions:
11
+ contents: read
11
12
  jobs:
12
13
  build:
13
14
  name: Run linters and check build scripts
@@ -18,7 +19,7 @@ jobs:
18
19
  - name: Use Node.js
19
20
  uses: actions/setup-node@v3
20
21
  with:
21
- node-version: '18.x'
22
+ node-version: '24.x'
22
23
  cache: 'npm'
23
24
  - name: Install
24
25
  run: yarn install
@@ -4,7 +4,8 @@ on:
4
4
  workflow_dispatch:
5
5
  release:
6
6
  types: [created]
7
-
7
+ permissions:
8
+ contents: write
8
9
  jobs:
9
10
  build-and-deploy:
10
11
  runs-on: ubuntu-latest
@@ -16,7 +17,7 @@ jobs:
16
17
  - name: Setup Node
17
18
  uses: actions/setup-node@v3
18
19
  with:
19
- node-version: '18.x'
20
+ node-version: '24.x'
20
21
  registry-url: 'https://registry.npmjs.org'
21
22
  - name: Install 🔧
22
23
  run: | # Install npm packages
@@ -3,7 +3,8 @@ name: Deploy to NPM and GHP
3
3
  on:
4
4
  release:
5
5
  types: [published]
6
-
6
+ permissions:
7
+ contents: read
7
8
  jobs:
8
9
  build-npm:
9
10
  runs-on: ubuntu-latest
@@ -11,7 +12,7 @@ jobs:
11
12
  - uses: actions/checkout@v3
12
13
  - uses: actions/setup-node@v3
13
14
  with:
14
- node-version: '18.x'
15
+ node-version: '24.x'
15
16
  registry-url: 'https://registry.npmjs.org'
16
17
  - run: yarn install --immutable
17
18
  - run: yarn build
@@ -24,7 +25,7 @@ jobs:
24
25
  - uses: actions/checkout@v3
25
26
  - uses: actions/setup-node@v3
26
27
  with:
27
- node-version: '18.x'
28
+ node-version: '24.x'
28
29
  registry-url: https://npm.pkg.github.com/
29
30
  - run: yarn install --immutable
30
31
  - run: yarn build
package/.node-version ADDED
@@ -0,0 +1 @@
1
+ 22.14.0
package/.prettierignore CHANGED
@@ -1,3 +1,4 @@
1
1
  # Tools
2
2
  tools/templates
3
3
  .yarn/*
4
+ optics-design-system.code-workspace
package/.stylelintrc.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "extends": ["stylelint-config-idiomatic-order"],
3
- "plugins": ["stylelint-prettier"],
3
+ "plugins": ["stylelint-prettier", "stylelint-use-logical"],
4
4
  "overrides": [],
5
5
  "rules": {
6
6
  "prettier/prettier": true,
@@ -10,6 +10,7 @@
10
10
  "message": "CSS variables should be prefixed with op-"
11
11
  }
12
12
  ],
13
- "selector-class-pattern": null
13
+ "selector-class-pattern": null,
14
+ "csstools/use-logical": "always"
14
15
  }
15
16
  }
Binary file
@@ -108,16 +108,17 @@ function addToJson(keys, data, value) {
108
108
  }
109
109
 
110
110
  try {
111
- const arguments = {}
111
+ const parsedArgs = {}
112
+
112
113
  process.argv.forEach((argument) => {
113
114
  const values = argument.slice(2).split('=')
114
115
  if (values.length === 2) {
115
- arguments[values[0]] = values[1]
116
+ parsedArgs[values[0]] = values[1]
116
117
  }
117
118
  })
118
119
 
119
- const source = arguments['source'] || 'src/core/tokens'
120
- const output = arguments['output'] || './dist/tokens'
120
+ const source = parsedArgs['source'] || 'src/core/tokens'
121
+ const output = parsedArgs['output'] || './dist/tokens'
121
122
  const outputPath = path.dirname(output)
122
123
  const outputFile = path.basename(output)
123
124
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  position: absolute;
5
5
  z-index: var(--op-z-index-sidebar);
6
- width: var(--op-panel-width);
7
- height: 100vh;
8
6
  background-color: var(--op-color-background);
7
+ block-size: 100vh;
9
8
  color: var(--op-color-on-background);
9
+ inline-size: var(--op-panel-width);
10
10
  inset-inline-end: calc(-1 * var(--op-panel-width)); /* this pushes the panel off the screen to the right */
11
11
  overflow-y: scroll;
12
12
  padding-block-end: var(--op-space-large);
@@ -23,7 +23,7 @@
23
23
  padding: var(--op-space-medium);
24
24
  border-radius: 100%;
25
25
  cursor: pointer;
26
- float: right;
26
+ float: inline-end;
27
27
 
28
28
  &:hover {
29
29
  background-color: var(--op-color-neutral-plus-seven);
@@ -2,7 +2,6 @@
2
2
  .ts-wrapper {
3
3
  /* Control */
4
4
  .ts-control {
5
- min-height: var(--op-input-height-large);
6
5
  align-items: center;
7
6
  border: none;
8
7
  border-radius: var(--op-radius-large);
@@ -12,13 +11,14 @@
12
11
  font-size: var(--op-font-x-small);
13
12
  font-weight: var(--op-font-weight-light);
14
13
  line-height: var(--op-line-height-base);
14
+ min-block-size: var(--op-input-height-large);
15
15
  }
16
16
 
17
17
  /* Active control */
18
18
  &.dropdown-active {
19
19
  .ts-control {
20
- border-bottom-left-radius: 0;
21
- border-bottom-right-radius: 0;
20
+ border-end-end-radius: 0;
21
+ border-end-start-radius: 0;
22
22
  }
23
23
  }
24
24
 
@@ -26,8 +26,8 @@
26
26
  .ts-dropdown {
27
27
  border: none;
28
28
  margin: 0;
29
- border-bottom-left-radius: var(--op-radius-large);
30
- border-bottom-right-radius: var(--op-radius-large);
29
+ border-end-end-radius: var(--op-radius-large);
30
+ border-end-start-radius: var(--op-radius-large);
31
31
  box-shadow: var(--op-border-all) var(--op-color-border);
32
32
  contain: paint;
33
33
 
@@ -9,11 +9,11 @@
9
9
 
10
10
  summary {
11
11
  display: grid;
12
- min-height: var(--_op-accordion-summary-min-height);
13
12
  align-items: center;
14
13
  cursor: pointer;
15
14
  gap: var(--op-space-2x-small);
16
15
  grid-template-columns: auto 1fr auto;
16
+ min-block-size: var(--_op-accordion-summary-min-height);
17
17
 
18
18
  &::marker,
19
19
  &::-webkit-details-marker {
@@ -38,7 +38,7 @@
38
38
  }
39
39
 
40
40
  &::details-content {
41
- height: 0;
41
+ block-size: 0;
42
42
  transition: var(--op-transition-accordion-content);
43
43
  }
44
44
 
@@ -48,7 +48,7 @@
48
48
  }
49
49
 
50
50
  &::details-content {
51
- height: auto;
51
+ block-size: auto;
52
52
  }
53
53
  }
54
54
 
@@ -36,9 +36,9 @@
36
36
  &.alert--flash {
37
37
  position: fixed;
38
38
  z-index: var(--op-z-index-alert-group);
39
- top: var(--op-space-large);
40
- right: var(--op-space-large);
41
39
  animation: var(--op-animation-flash);
40
+ inset-block-start: var(--op-space-large);
41
+ inset-inline-end: var(--op-space-large);
42
42
  }
43
43
 
44
44
  &.alert--warning {
@@ -18,11 +18,11 @@
18
18
  z-index: 1;
19
19
  display: block;
20
20
  overflow: hidden;
21
- width: var(--__op-avatar-size);
22
- min-width: var(--__op-avatar-size);
23
- height: var(--__op-avatar-size);
24
- min-height: var(--__op-avatar-size);
25
21
  border-radius: var(--_op-avatar-border-radius);
22
+ block-size: var(--__op-avatar-size);
23
+ inline-size: var(--__op-avatar-size);
24
+ min-block-size: var(--__op-avatar-size);
25
+ min-inline-size: var(--__op-avatar-size);
26
26
 
27
27
  &::before {
28
28
  position: absolute;
@@ -43,8 +43,8 @@
43
43
  }
44
44
 
45
45
  img {
46
- width: 100%;
47
- height: 100%;
46
+ block-size: 100%;
47
+ inline-size: 100%;
48
48
  object-fit: cover;
49
49
  }
50
50
 
@@ -16,7 +16,6 @@
16
16
  --__op-btn-padding: var(--_op-btn-padding-large);
17
17
 
18
18
  display: inline-flex;
19
- min-height: var(--__op-btn-height);
20
19
  align-items: center;
21
20
  justify-content: center;
22
21
  padding: var(--__op-btn-padding);
@@ -29,6 +28,7 @@
29
28
  font-size: var(--__op-btn-font-size);
30
29
  font-weight: var(--op-font-weight-normal);
31
30
  gap: var(--op-space-x-small);
31
+ min-block-size: var(--__op-btn-height);
32
32
  text-align: center;
33
33
  text-decoration: none;
34
34
  transition: var(--op-transition-input);
@@ -92,9 +92,9 @@
92
92
 
93
93
  /* Icon Modifier */
94
94
  &.btn--icon {
95
- width: var(--__op-btn-height);
96
- min-width: var(--__op-btn-height);
97
95
  padding: 0;
96
+ inline-size: var(--__op-btn-height);
97
+ min-inline-size: var(--__op-btn-height);
98
98
  }
99
99
 
100
100
  /* Icon With Label Modifier */
@@ -30,13 +30,13 @@
30
30
  }
31
31
 
32
32
  &:first-child:not(:last-child) {
33
- border-bottom-right-radius: 0;
34
- border-top-right-radius: 0;
33
+ border-end-end-radius: 0;
34
+ border-start-end-radius: 0;
35
35
  }
36
36
 
37
37
  &:last-child:not(:first-child) {
38
- border-bottom-left-radius: 0;
39
- border-top-left-radius: 0;
38
+ border-end-start-radius: 0;
39
+ border-start-start-radius: 0;
40
40
  }
41
41
  }
42
42
  }
@@ -50,8 +50,8 @@
50
50
  }
51
51
 
52
52
  .card__header {
53
- border-top-left-radius: var(--_op-card-radius);
54
- border-top-right-radius: var(--_op-card-radius);
53
+ border-start-end-radius: var(--_op-card-radius);
54
+ border-start-start-radius: var(--_op-card-radius);
55
55
 
56
56
  h1,
57
57
  h2,
@@ -64,7 +64,7 @@
64
64
  }
65
65
 
66
66
  .card__footer {
67
- border-bottom-left-radius: var(--_op-card-radius);
68
- border-bottom-right-radius: var(--_op-card-radius);
67
+ border-end-end-radius: var(--_op-card-radius);
68
+ border-end-start-radius: var(--_op-card-radius);
69
69
  }
70
70
  }
@@ -44,13 +44,13 @@
44
44
  --_op-confirm-dialog-width: calc(100 * var(--op-size-unit)); /* 400px */
45
45
 
46
46
  z-index: var(--op-z-index-dialog-content);
47
- width: var(--_op-confirm-dialog-width);
48
47
  border-radius: var(--op-radius-medium);
49
48
  background-color: var(--op-color-background);
50
49
  box-shadow: var(--op-border-all) var(--op-color-border);
51
50
  color: var(--op-color-on-background);
52
51
  contain: paint;
53
52
  font-size: var(--op-font-medium);
53
+ inline-size: var(--_op-confirm-dialog-width);
54
54
  line-height: var(--op-line-height-base);
55
55
  opacity: var(--op-opacity-none);
56
56
  transform: scale(0.7);
@@ -11,12 +11,12 @@
11
11
  /* Private API (component option defaults) */
12
12
  --__op-divider-height: var(--_op-divider-height-small);
13
13
  --__op-divider-padding: 0;
14
-
15
- width: 100%;
16
- height: var(--__op-divider-height);
17
14
  background-color: var(--op-color-border);
15
+ block-size: var(--__op-divider-height);
16
+ inline-size: 100%;
18
17
  margin-block: var(--__op-divider-padding);
19
18
  margin-inline: 0;
19
+ min-block-size: var(--__op-divider-height);
20
20
 
21
21
  /* Size Modifiers */
22
22
  &.divider--small {
@@ -46,10 +46,11 @@
46
46
 
47
47
  /* Direction Modifier */
48
48
  &.divider--vertical {
49
- width: var(--__op-divider-height);
50
- height: 100%;
51
- min-height: var(--_op-divider-vertical-min-height);
49
+ block-size: 100%;
50
+ inline-size: var(--__op-divider-height);
52
51
  margin-block: 0;
53
52
  margin-inline: var(--__op-divider-padding);
53
+ min-block-size: var(--_op-divider-vertical-min-height);
54
+ min-inline-size: var(--__op-divider-height);
54
55
  }
55
56
  }
@@ -10,9 +10,8 @@
10
10
  /* Private API (component option defaults) */
11
11
  --__op-form-control-height: var(--_op-form-control-height-large);
12
12
  --__op-form-control-font-size: var(--_op-form-control-font-large);
13
-
14
- min-width: var(--__op-form-control-height);
15
- height: var(--__op-form-control-height);
13
+ block-size: var(--__op-form-control-height);
14
+ min-inline-size: var(--__op-form-control-height);
16
15
 
17
16
  /* Size Modifiers */
18
17
  &.form-control--small {
@@ -60,12 +59,12 @@
60
59
  --_op-form-control-height-medium: var(--op-space-large);
61
60
  --_op-form-control-height-large: var(--op-space-x-large);
62
61
 
63
- width: var(--__op-form-control-height);
64
- height: var(--__op-form-control-height);
65
62
  align-self: center;
66
63
  margin: 0;
67
64
  accent-color: var(--op-color-primary-base);
65
+ block-size: var(--__op-form-control-height);
68
66
  cursor: pointer;
67
+ inline-size: var(--__op-form-control-height);
69
68
 
70
69
  & + label {
71
70
  align-self: center;
@@ -81,18 +80,18 @@
81
80
  --__op-form-control-border-color: var(--op-color-neutral-plus-four);
82
81
 
83
82
  display: block;
84
- width: 100%;
85
- min-width: var(--__op-form-control-height);
86
- height: var(--__op-form-control-height);
87
83
  border: none;
88
84
  border-radius: var(--op-radius-medium);
89
85
  appearance: none;
90
86
  background-color: var(--op-color-neutral-plus-eight);
87
+ block-size: var(--__op-form-control-height);
91
88
  box-shadow: var(--op-border-all) var(--__op-form-control-border-color);
92
89
  color: var(--op-color-neutral-on-plus-eight);
93
90
  cursor: text;
94
91
  font-size: var(--__op-form-control-font-size);
92
+ inline-size: 100%;
95
93
  line-height: var(--op-line-height-base);
94
+ min-inline-size: var(--__op-form-control-height);
96
95
  padding-block: var(--op-space-2x-small);
97
96
  padding-inline: var(--op-space-small) var(--op-space-x-small);
98
97
 
@@ -159,7 +158,6 @@
159
158
  --__op-btn-height: var(--__op-btn-base-height);
160
159
 
161
160
  display: inline-flex;
162
- min-height: var(--__op-btn-height);
163
161
  align-items: center;
164
162
  justify-content: center;
165
163
  border: none;
@@ -173,6 +171,7 @@
173
171
  font-weight: var(--op-font-weight-normal);
174
172
  gap: var(--op-space-x-small);
175
173
  margin-block: calc((var(--__op-form-control-height) / 2) - (var(--__op-btn-height) / 2));
174
+ min-block-size: var(--__op-btn-height);
176
175
  padding-block: 0;
177
176
  padding-inline: var(--op-space-x-small);
178
177
  text-align: center;
@@ -199,13 +198,13 @@ select.form-control:not([multiple], [type='radio'], [type='checkbox']) {
199
198
  }
200
199
 
201
200
  select.form-control[multiple] {
202
- min-height: calc(2 * var(--__op-form-control-height));
201
+ min-block-size: calc(2 * var(--__op-form-control-height));
203
202
  }
204
203
 
205
204
  textarea.form-control:not([type='radio'], [type='checkbox']) {
206
- max-width: 100%;
207
- height: calc(2 * var(--__op-form-control-height));
208
- min-height: var(--__op-form-control-height);
205
+ block-size: calc(2 * var(--__op-form-control-height));
206
+ max-inline-size: 100%;
207
+ min-block-size: var(--__op-form-control-height);
209
208
  }
210
209
 
211
210
  .form-label {
@@ -217,9 +216,9 @@ textarea.form-control:not([type='radio'], [type='checkbox']) {
217
216
  }
218
217
 
219
218
  .form-error {
220
- width: fit-content;
221
219
  color: var(--op-color-alerts-danger-base);
222
220
  font-size: var(--op-font-x-small);
221
+ inline-size: fit-content;
223
222
  }
224
223
 
225
224
  .form-hint {
@@ -259,7 +258,8 @@ textarea.form-control:not([type='radio'], [type='checkbox']) {
259
258
  .form-label,
260
259
  .form-error,
261
260
  .form-hint,
262
- .form-control:not([type='radio'], [type='checkbox']) {
261
+ .form-control:not([type='radio'], [type='checkbox']),
262
+ .segmented-control {
263
263
  grid-column: 1 / 3;
264
264
  }
265
265
  /* stylelint-enable no-descending-specificity */
@@ -34,10 +34,10 @@
34
34
  --__op-icon-optical-size: var(--_op-icon-optical-size-medium);
35
35
 
36
36
  display: inline-block;
37
- width: var(--__op-icon-font-size);
38
- height: var(--__op-icon-font-size);
37
+ block-size: var(--__op-icon-font-size);
39
38
  font-size: var(--__op-icon-font-size);
40
39
  font-weight: var(--__op-icon-weight);
40
+ inline-size: var(--__op-icon-font-size);
41
41
  line-height: var(--op-line-height-densest);
42
42
  vertical-align: middle;
43
43
 
@@ -115,7 +115,7 @@
115
115
  /* Custom SVG Icons app specific */
116
116
  .custom-icons {
117
117
  svg {
118
- width: 100%;
119
- height: 100%;
118
+ block-size: 100%;
119
+ inline-size: 100%;
120
120
  }
121
121
  }
@@ -14,6 +14,7 @@
14
14
  @import 'modal';
15
15
  @import 'navbar';
16
16
  @import 'pagination';
17
+ @import 'segmented-control';
17
18
  @import 'sidebar';
18
19
  @import 'side_panel';
19
20
  @import 'spinner';
@@ -41,20 +41,19 @@
41
41
  }
42
42
  }
43
43
 
44
- /* stylelint-disable no-descending-specificity */
45
44
  .modal {
46
45
  /* Public API (customizable component options) */
47
46
  --_op-modal-width: calc(141 * var(--op-size-unit)); /* 564px */
48
47
  --_op-modal-max-height: calc(125 * var(--op-size-unit)); /* 500px */
49
48
 
50
49
  z-index: var(--op-z-index-dialog-content);
51
- width: var(--_op-modal-width);
52
50
  border-radius: var(--op-radius-medium);
53
51
  background-color: var(--op-color-background);
54
52
  box-shadow: var(--op-border-all) var(--op-color-border);
55
53
  color: var(--op-color-on-background);
56
54
  contain: paint;
57
55
  font-size: var(--op-font-medium);
56
+ inline-size: var(--_op-modal-width);
58
57
  line-height: var(--op-line-height-base);
59
58
  opacity: var(--op-opacity-none);
60
59
  transform: scale(0.7);
@@ -75,8 +74,8 @@
75
74
  }
76
75
 
77
76
  .modal__body {
78
- max-height: var(--_op-modal-max-height);
79
77
  box-shadow: var(--op-border-all) var(--op-color-border);
78
+ max-block-size: var(--_op-modal-max-height);
80
79
  overflow-y: auto;
81
80
  }
82
81
 
@@ -87,63 +86,46 @@
87
86
  gap: var(--op-space-small);
88
87
  }
89
88
  }
90
- /* stylelint-enable no-descending-specificity */
91
89
 
92
90
  dialog.modal {
93
- position: fixed;
94
- display: block;
95
91
  padding: 0;
96
92
  border: none;
97
- inset: 0;
93
+ overscroll-behavior: contain;
94
+ transform: scale(0.7);
95
+ transition:
96
+ display var(--op-transition-modal-time) allow-discrete,
97
+ overlay var(--op-transition-modal-time) allow-discrete,
98
+ transform var(--op-transition-modal-time),
99
+ opacity var(--op-transition-modal-time);
98
100
 
99
101
  &::backdrop {
100
- /* The Dialog backdrop does not inheret from :root so these need to be duplicated here. */
101
- --op-color-black: hsl(0deg 0% 0%);
102
- --_op-modal-backdrop-active-opacity: 0.5;
103
- --op-opacity-none: 0;
104
- --op-opacity-full: 1;
105
-
106
- animation: show-backdrop 300ms ease-in;
107
- background: var(--op-color-black);
108
- opacity: var(--_op-modal-backdrop-active-opacity);
102
+ overflow: hidden;
103
+ background-color: var(--op-color-black);
104
+ opacity: var(--op-opacity-none);
105
+ overscroll-behavior: contain;
106
+ transition:
107
+ display var(--op-transition-modal-time) allow-discrete,
108
+ overlay var(--op-transition-modal-time) allow-discrete,
109
+ transform var(--op-transition-modal-time),
110
+ opacity var(--op-transition-modal-time);
109
111
  }
110
112
 
111
113
  &[open] {
112
114
  opacity: var(--op-opacity-full);
113
115
  transform: scale(1);
114
- }
115
-
116
- &.modal--closing {
117
- opacity: var(--op-opacity-none);
118
- transform: scale(0.7);
119
116
 
120
117
  &::backdrop {
121
- animation: hide-backdrop 300ms ease-in;
122
- opacity: var(--op-opacity-none);
118
+ opacity: var(--op-opacity-half);
123
119
  }
124
120
  }
125
121
  }
126
122
 
127
- /* Using the Dialog element */
128
-
129
- /* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog */
130
-
131
- @keyframes show-backdrop {
132
- from {
133
- opacity: var(--op-opacity-none);
134
- }
135
-
136
- to {
137
- opacity: var(--_op-modal-backdrop-active-opacity);
138
- }
139
- }
140
-
141
- @keyframes hide-backdrop {
142
- from {
143
- opacity: var(--_op-modal-backdrop-active-opacity);
144
- }
123
+ @starting-style {
124
+ dialog.modal[open] {
125
+ transform: scale(0.7);
145
126
 
146
- to {
147
- opacity: var(--op-opacity-none);
127
+ &::backdrop {
128
+ opacity: var(--op-opacity-none);
129
+ }
148
130
  }
149
131
  }