Skip to content

Commit

Permalink
refactor: corrected expanded tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
PKulkoRaccoonGang committed Sep 9, 2024
1 parent e73a4f9 commit 55c47d5
Show file tree
Hide file tree
Showing 29 changed files with 1,343 additions and 266 deletions.
4 changes: 2 additions & 2 deletions lib/build-tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const {
initializeStyleDictionary,
colorTransform,
} = require('../tokens/style-dictionary');
const { createIndexCssFile, constructExpandedToken } = require('../tokens/utils');
const { createIndexCssFile } = require('../tokens/utils');

/**
* Builds tokens for CSS styles from JSON source files.
Expand Down Expand Up @@ -53,7 +53,7 @@ async function buildTokensCommand(commandArgs) {
path.resolve(__dirname, '../tokens/src/core/**/*.json'),
path.resolve(__dirname, '../tokens/src/core/**/*.toml'),
],
expand: (token) => constructExpandedToken(token),
expand: true,
source: tokensSource
? [`${tokensSource}/core/**/*.json`, `${tokensSource}/core/**/*.toml`]
: [],
Expand Down
14 changes: 13 additions & 1 deletion src/Annotation/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@
padding: var(--pgn-spacing-annotation-padding);
border-radius: var(--pgn-size-annotation-border-radius);
max-width: var(--pgn-size-annotation-max-width);
filter: var(--pgn-elevation-annotation-box-shadow);
filter:
drop-shadow(
var(--pgn-elevation-annotation-box-shadow-1-offset-x)
var(--pgn-elevation-annotation-box-shadow-1-offset-y)
var(--pgn-elevation-annotation-box-shadow-1-blur)
var(--pgn-elevation-annotation-box-shadow-1-color)
),
drop-shadow(
var(--pgn-elevation-annotation-box-shadow-2-offset-x)
var(--pgn-elevation-annotation-box-shadow-2-offset-y)
var(--pgn-elevation-annotation-box-shadow-2-blur)
var(--pgn-elevation-annotation-box-shadow-2-color)
);
word-wrap: break-word;
position: relative;
display: inline-block;
Expand Down
10 changes: 9 additions & 1 deletion src/Card/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,15 @@ a.pgn__card {
width: var(--pgn-size-card-logo-width);
height: var(--pgn-size-card-logo-height);
border-radius: var(--pgn-size-card-border-radius-logo);
box-shadow: var(--pgn-elevation-box-shadow-level-1);
box-shadow:
var(--pgn-elevation-box-shadow-level-1-1-offset-y)
var(--pgn-elevation-box-shadow-level-1-1-offset-x)
var(--pgn-elevation-box-shadow-level-1-1-blur)
var(--pgn-elevation-box-shadow-level-1-1-color),
var(--pgn-elevation-box-shadow-level-1-2-offset-y)
var(--pgn-elevation-box-shadow-level-1-2-offset-x)
var(--pgn-elevation-box-shadow-level-1-2-blur)
var(--pgn-elevation-box-shadow-level-1-2-color);
padding: map_get($spacers, 2);
background-color: var(--pgn-color-white);
display: none;
Expand Down
12 changes: 10 additions & 2 deletions src/Carousel/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
width: 100%;
margin-right: -100%;
backface-visibility: hidden;
transition: var(--pgn-transition-carousel-base);
transition:
var(--pgn-transition-carousel-base-property)
var(--pgn-transition-carousel-base-duration)
var(--pgn-transition-carousel-base-timing-function)
var(--pgn-transition-carousel-base-delay);
}

.carousel-item.active,
Expand Down Expand Up @@ -58,7 +62,11 @@
.active.carousel-item-right {
z-index: 0;
opacity: 0;
transition: opacity 0s var(--pgn-transition-carousel-base);
transition:
opacity 0s var(--pgn-transition-carousel-base-property)
var(--pgn-transition-carousel-base-duration)
var(--pgn-transition-carousel-base-timing-function)
var(--pgn-transition-carousel-base-delay);
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/CloseButton/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
font-weight: var(--pgn-typography-close-button-font-weight);
line-height: 1;
color: var(--pgn-color-close-button);
text-shadow: var(--pgn-elevation-close-button-text-shadow);
text-shadow:
var(--pgn-elevation-close-button-text-shadow-offset-x)
var(--pgn-elevation-close-button-text-shadow-offset-y)
var(--pgn-elevation-close-button-text-shadow-blur)
var(--pgn-elevation-close-button-text-shadow-color);
opacity: .5;

@include font-size(var(--pgn-typography-close-button-font-size));
Expand Down
22 changes: 19 additions & 3 deletions src/DataTable/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
font-size: var(--pgn-typography-font-size-sm);
border-radius: var(--pgn-size-border-radius-base);
background-color: var(--pgn-color-data-table-bg-base);
box-shadow: var(--pgn-elevation-data-table-box-shadow);
box-shadow:
var(--pgn-elevation-data-table-box-shadow-offset-x)
var(--pgn-elevation-data-table-box-shadow-offset-y)
var(--pgn-elevation-data-table-box-shadow-blur)
var(--pgn-elevation-data-table-box-shadow-color);

&.hide-shadow {
box-shadow: none;
Expand Down Expand Up @@ -93,7 +97,11 @@
.pgn__data-table-layout-sidebar {
background-color: var(--pgn-color-data-table-bg-base);
border-radius: var(--pgn-size-border-radius-base);
box-shadow: var(--pgn-elevation-data-table-box-shadow);
box-shadow:
var(--pgn-elevation-data-table-box-shadow-offset-x)
var(--pgn-elevation-data-table-box-shadow-offset-y)
var(--pgn-elevation-data-table-box-shadow-blur)
var(--pgn-elevation-data-table-box-shadow-color);
padding: var(--pgn-spacing-data-table-padding-small);
margin-right: var(--pgn-spacing-spacer-4);
flex: 0 0 var(--pgn-size-data-table-layout-sidebar-width);
Expand Down Expand Up @@ -286,7 +294,15 @@
.pgn__data-table__overflow-actions-menu {
background: var(--pgn-color-white);
padding: var(--pgn-spacing-spacer-2);
box-shadow: var(--pgn-elevation-box-shadow-level-1);
box-shadow:
var(--pgn-elevation-box-shadow-level-1-1-offset-y)
var(--pgn-elevation-box-shadow-level-1-1-offset-x)
var(--pgn-elevation-box-shadow-level-1-1-blur)
var(--pgn-elevation-box-shadow-level-1-1-color),
var(--pgn-elevation-box-shadow-level-1-2-offset-y)
var(--pgn-elevation-box-shadow-level-1-2-offset-x)
var(--pgn-elevation-box-shadow-level-1-2-blur)
var(--pgn-elevation-box-shadow-level-1-2-color);
border-radius: 4px;
}

Expand Down
32 changes: 28 additions & 4 deletions src/Dropzone/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,43 @@
}

&:hover {
box-shadow: var(--pgn-elevation-dropzone-hover);
box-shadow:
var(--pgn-elevation-dropzone-hover-inset)
var(--pgn-elevation-dropzone-hover-offset-x)
var(--pgn-elevation-dropzone-hover-offset-y)
var(--pgn-elevation-dropzone-hover-blur)
var(--pgn-elevation-dropzone-hover-spread)
var(--pgn-elevation-dropzone-hover-color);
}

&:focus {
box-shadow: var(--pgn-elevation-dropzone-focus);
box-shadow:
var(--pgn-elevation-dropzone-focus-inset)
var(--pgn-elevation-dropzone-focus-offset-x)
var(--pgn-elevation-dropzone-focus-offset-y)
var(--pgn-elevation-dropzone-focus-blur)
var(--pgn-elevation-dropzone-focus-spread)
var(--pgn-elevation-dropzone-focus-color);
}

&.pgn__dropzone-validation-error {
box-shadow: var(--pgn-elevation-dropzone-error);
box-shadow:
var(--pgn-elevation-dropzone-error-inset)
var(--pgn-elevation-dropzone-error-offset-x)
var(--pgn-elevation-dropzone-error-offset-y)
var(--pgn-elevation-dropzone-error-blur)
var(--pgn-elevation-dropzone-error-spread)
var(--pgn-elevation-dropzone-error-color);
}

&.pgn__dropzone-active {
box-shadow: var(--pgn-elevation-dropzone-active);
box-shadow:
var(--pgn-elevation-dropzone-active-inset)
var(--pgn-elevation-dropzone-active-offset-x)
var(--pgn-elevation-dropzone-active-offset-y)
var(--pgn-elevation-dropzone-active-blur)
var(--pgn-elevation-dropzone-active-spread)
var(--pgn-elevation-dropzone-active-color);
}
}

Expand Down
21 changes: 18 additions & 3 deletions src/Form/_bootstrap-custom-forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@
}

&:focus ~ .custom-control-label::before {
box-shadow: var(--pgn-elevation-form-control-indicator-checked-focus);
box-shadow:
var(--pgn-elevation-form-control-indicator-checked-focus-offset-x)
var(--pgn-elevation-form-control-indicator-checked-focus-offset-y)
var(--pgn-elevation-form-control-indicator-checked-focus-blur)
var(--pgn-elevation-form-control-indicator-checked-focus-spread)
var(--pgn-elevation-form-control-indicator-checked-focus-color);
}

&:focus:not(:checked) ~ .custom-control-label::before {
Expand Down Expand Up @@ -249,7 +254,12 @@
&:focus {
border-color: var(--pgn-color-form-control-select-border-focus);
outline: 0;
box-shadow: var(--pgn-elevation-form-control-select-border-focus);
box-shadow:
var(--pgn-elevation-form-control-select-border-focus-offset-x)
var(--pgn-elevation-form-control-select-border-focus-offset-y)
var(--pgn-elevation-form-control-select-border-focus-blur)
var(--pgn-elevation-form-control-select-border-focus-spread)
var(--pgn-elevation-form-control-select-border-focus-color);

&::-ms-value {
// For visual consistency with other platforms/browsers,
Expand Down Expand Up @@ -328,7 +338,12 @@

&:focus ~ .custom-file-label {
border-color: var(--pgn-color-form-control-file-border-focus);
box-shadow: var(--pgn-elevation-form-control-file-focus);
box-shadow:
var(--pgn-elevation-form-control-file-focus-offset-x)
var(--pgn-elevation-form-control-file-focus-offset-y)
var(--pgn-elevation-form-control-file-focus-blur)
var(--pgn-elevation-form-control-file-focus-spread)
var(--pgn-elevation-form-control-file-focus-color);
}

// Use [disabled] and :disabled to work around https://github.com/twbs/bootstrap/issues/28247
Expand Down
7 changes: 6 additions & 1 deletion src/Form/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,12 @@ select.form-control {
}

&:not(:disabled):hover {
box-shadow: var(--pgn-elevation-form-control-indicator-checked-focus);
box-shadow:
var(--pgn-elevation-form-control-indicator-checked-focus-offset-x)
var(--pgn-elevation-form-control-indicator-checked-focus-offset-y)
var(--pgn-elevation-form-control-indicator-checked-focus-blur)
var(--pgn-elevation-form-control-indicator-checked-focus-spread)
var(--pgn-elevation-form-control-indicator-checked-focus-color);
}

&:disabled {
Expand Down
7 changes: 6 additions & 1 deletion src/Form/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@
background-color: var(--pgn-color-form-input-focus-bg);
border-color: var(--pgn-color-form-input-focus-border);
outline: 0;
box-shadow: var(--pgn-elevation-form-input-focus);
box-shadow:
var(--pgn-elevation-form-input-focus-offset-x)
var(--pgn-elevation-form-input-focus-offset-y)
var(--pgn-elevation-form-input-focus-blur)
var(--pgn-elevation-form-input-focus-spread)
var(--pgn-elevation-form-input-focus-color);
}

@include deprecate("The `form-control-focus()` mixin", "v4.4.0", "v5", $ignore-warning);
Expand Down
Loading

0 comments on commit 55c47d5

Please sign in to comment.