Skip to content

Commit 4278981

Browse files
authored
fix(alert): add public --calcite-alert-offset-size css token (#10872)
**Related Issue:** [#10520](#10520) ## Summary Rename internal `--calcite-internal-alert-edge-distance` css token to `--calcite-alert-offset-size` and make it public.
1 parent b0d5802 commit 4278981

File tree

1 file changed

+10
-10
lines changed
  • packages/calcite-components/src/components/alert

1 file changed

+10
-10
lines changed

packages/calcite-components/src/components/alert/alert.scss

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
* @prop --calcite-alert-background-color: Specifies the component's background color.
88
* @prop --calcite-alert-corner-radius: Specifies the component's corner radius.
99
* @prop --calcite-alert-shadow: Specifies the component's shadow.
10+
* @prop --calcite-alert-offset-size: Specifies the component's `placement` offset.
1011
*/
1112

1213
$border-style: 1px solid var(--calcite-color-border-3);
1314

1415
:host {
15-
--calcite-internal-alert-edge-distance: theme("spacing.8");
1616
@apply block;
1717

1818
inline-size: var(--calcite-alert-width);
@@ -44,7 +44,7 @@ $border-style: 1px solid var(--calcite-color-border-3);
4444
border-block-start: 0 solid transparent;
4545
border-inline: $border-style;
4646
border-block-end: $border-style;
47-
max-inline-size: calc(100% - (var(--calcite-internal-alert-edge-distance) * 2));
47+
max-inline-size: calc(100% - (var(--calcite-alert-offset-size, theme("spacing.8")) * 2));
4848
transition:
4949
opacity var(--calcite-internal-animation-timing-slow) $easing-function,
5050
all var(--calcite-animation-timing) ease-in-out;
@@ -55,19 +55,19 @@ $border-style: 1px solid var(--calcite-color-border-3);
5555
inset-inline-start: 0;
5656
}
5757
&[class*="bottom"] {
58-
transform: translate3d(0, var(--calcite-internal-alert-edge-distance), 0);
59-
inset-block-end: var(--calcite-internal-alert-edge-distance);
58+
transform: translate3d(0, var(--calcite-alert-offset-size, theme("spacing.8")), 0);
59+
inset-block-end: var(--calcite-alert-offset-size, theme("spacing.8"));
6060
}
6161
&[class*="top"] {
62-
transform: translate3d(0, calc(-1 * var(--calcite-internal-alert-edge-distance)), 0);
63-
inset-block-start: var(--calcite-internal-alert-edge-distance);
62+
transform: translate3d(0, calc(-1 * var(--calcite-alert-offset-size, theme("spacing.8"))), 0);
63+
inset-block-start: var(--calcite-alert-offset-size, theme("spacing.8"));
6464
}
6565
&[class*="start"] {
66-
inset-inline-start: var(--calcite-internal-alert-edge-distance);
66+
inset-inline-start: var(--calcite-alert-offset-size, theme("spacing.8"));
6767
inset-inline-end: auto;
6868
}
6969
&[class*="end"] {
70-
inset-inline-end: var(--calcite-internal-alert-edge-distance);
70+
inset-inline-end: var(--calcite-alert-offset-size, theme("spacing.8"));
7171
inset-inline-start: auto;
7272
}
7373
}
@@ -248,10 +248,10 @@ $border-style: 1px solid var(--calcite-color-border-3);
248248
@apply border-t-2 opacity-100;
249249
pointer-events: initial;
250250
&[class*="bottom"] {
251-
transform: translate3d(0, calc(-1 * var(--calcite-internal-alert-edge-distance)), inherit);
251+
transform: translate3d(0, calc(-1 * var(--calcite-alert-offset-size, theme("spacing.8"))), inherit);
252252
}
253253
&[class*="top"] {
254-
transform: translate3d(0, var(--calcite-internal-alert-edge-distance), inherit);
254+
transform: translate3d(0, var(--calcite-alert-offset-size, theme("spacing.8")), inherit);
255255
}
256256
}
257257
}

0 commit comments

Comments
 (0)