Skip to content

Commit

Permalink
fix(popover): update styles to reconfigure trigger and box-shadow
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjones243 authored and jason-capsule42 committed Sep 30, 2024
1 parent a77f22e commit 6228987
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](

<!-- AURO-GENERATED-CONTENT:END -->

### CSS Custom Property fallbacks

<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/cssFallbacks.md) -->
[CSS custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties) are [not supported](https://auro.alaskaair.com/support/custom-properties) in older browsers. For this, fallback properties are pre-generated and included with the npm.

Any update to the Auro Design Tokens will be immediately reflected with browsers that support CSS custom properties, legacy browsers will require updated components with pre-generated fallback properties.

<!-- AURO-GENERATED-CONTENT:END -->

### Define dependency in project component

<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/componentImportDescription.md) -->
Expand Down
10 changes: 7 additions & 3 deletions demo/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,14 @@ The component may be restyled using the following code sample and changing the v
<!-- The below code snippet is automatically added from ./../../src/tokens.scss -->

```scss
/* stylelint-disable color-function-notation */

@import './../node_modules/@aurodesignsystem/design-tokens/dist/tokens/SCSSVariables';

:host {
--ds-auro-popover-boxshadow-color: var(--ds-color-border-divider-default, $ds-color-border-divider-default);
--ds-auro-popover-container-color: var(--ds-color-container-primary-default, $ds-color-container-primary-default);
--ds-auro-popover-text-color: var(--ds-color-text-primary-default, $ds-color-text-primary-default);
--ds-auro-popover-boxshadow-color: var(--ds-color-base-black-300, #{$ds-color-base-black-300});
--ds-auro-popover-container-color: var(--ds-color-container-primary-default, #{$ds-color-container-primary-default});
--ds-auro-popover-text-color: var(--ds-color-text-primary-default, #{$ds-color-text-primary-default});
}
```
<!-- AURO-GENERATED-CONTENT:END -->
2 changes: 1 addition & 1 deletion src/color.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

.popover {
background-color: var(--ds-auro-popover-container-color);
box-shadow: -2px 0 5px 2px var(--ds-auro-popover-boxshadow-color) 0 2px 5px 1px var(--ds-auro-popover-boxshadow-color);
box-shadow: -2px 0 5px 2px var(--ds-auro-popover-boxshadow-color), 0 2px 5px 1px var(--ds-auro-popover-boxshadow-color);
}

.arrow {
Expand Down
7 changes: 5 additions & 2 deletions src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,11 @@ $auro-inset-directions: '';
bottom: calc(-1 * calc(var(--ds-size-100, $ds-size-100) + var(--ds-size-25, $ds-size-25)));

&:before {
top: -16px;
left: calc(-1 * var(--ds-size-200, $ds-size-200));
// calc = -16px
top: calc(-1 * var(--ds-size-200, $ds-size-200));

// calc = -6px
left: calc(-1 * var(--ds-size-75, $ds-size-75));

transform: rotate(45deg);
}
Expand Down
10 changes: 7 additions & 3 deletions src/tokens.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/* stylelint-disable color-function-notation */

@import './../node_modules/@aurodesignsystem/design-tokens/dist/tokens/SCSSVariables';

:host {
--ds-auro-popover-boxshadow-color: var(--ds-color-border-divider-default, $ds-color-border-divider-default);
--ds-auro-popover-container-color: var(--ds-color-container-primary-default, $ds-color-container-primary-default);
--ds-auro-popover-text-color: var(--ds-color-text-primary-default, $ds-color-text-primary-default);
--ds-auro-popover-boxshadow-color: var(--ds-color-base-black-300, #{$ds-color-base-black-300});
--ds-auro-popover-container-color: var(--ds-color-container-primary-default, #{$ds-color-container-primary-default});
--ds-auro-popover-text-color: var(--ds-color-text-primary-default, #{$ds-color-text-primary-default});
}

0 comments on commit 6228987

Please sign in to comment.