Skip to content

Commit

Permalink
Feat(web): Unify naming in SCSS, use padding instead of spacing and o…
Browse files Browse the repository at this point in the history
…ffset #DS-782

Only where it makes sense.
  • Loading branch information
crishpeen committed Jan 23, 2024
1 parent 0fa635a commit 245bad0
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/web/src/scss/components/Accordion/_Accordion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
}

.Accordion__content {
padding-bottom: theme.$accordion-content-bottom-offset;
padding-bottom: theme.$accordion-content-padding-bottom;
}

// 8.
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/scss/components/Accordion/_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ $accordion-border-radius: tokens.$radius-100;
$accordion-divider-color: tokens.$action-tertiary-default;
$accordion-divider-width: tokens.$border-width-100;
$accordion-divider-style: tokens.$border-style-100;
$accordion-content-bottom-offset: tokens.$space-600;
$accordion-content-padding-bottom: tokens.$space-600;
2 changes: 1 addition & 1 deletion packages/web/src/scss/components/Checkbox/_Checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $_field-name: 'Checkbox';
}

.Checkbox__text {
margin-left: form-fields-theme.$spacing;
margin-left: form-fields-theme.$padding;
}

.Checkbox__label {
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/scss/components/Item/_Item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@

.Item__icon--start {
grid-column: 1;
margin-inline-end: theme.$icon-spacing;
margin-inline-end: theme.$icon-padding;
}

.Item__icon--end {
grid-column: 3;
margin-inline-start: theme.$icon-spacing;
margin-inline-start: theme.$icon-padding;
}

.Item--selected .Item__label {
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/scss/components/Item/_theme.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@use '@tokens' as tokens;

$icon-spacing: tokens.$space-400;
$icon-padding: tokens.$space-400;
$icon-color-default: tokens.$action-selected-default;
$icon-color-disabled: tokens.$action-selected-disabled;
4 changes: 2 additions & 2 deletions packages/web/src/scss/components/Radio/_Radio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $_field-name: 'Radio';
.Radio__helperText {
@include form-fields-tools.helper-text();

margin-left: form-fields-theme.$spacing;
margin-left: form-fields-theme.$padding;
}

@include form-fields-tools.input-field-validation-states(
Expand All @@ -59,7 +59,7 @@ $_field-name: 'Radio';
.Radio__label {
@include form-fields-tools.inline-field-label();

margin-left: form-fields-theme.$spacing;
margin-left: form-fields-theme.$padding;
}

.Radio__label--hidden {
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/scss/theme/_form-fields.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use '@tokens' as tokens;

// Common for all form components
$spacing: tokens.$space-400;
$padding: tokens.$space-400;
$input-typography: tokens.$body-medium-text-regular;
$input-color-disabled: tokens.$text-primary-disabled;
$input-border-color-success: tokens.$emotion-success-default;
Expand Down Expand Up @@ -64,7 +64,7 @@ $validation-states: (
);

// Item variant
$item-spacing: tokens.$space-400;
$item-padding: tokens.$space-400;
$item-border-radius: tokens.$radius-100;
$item-background-color-default: tokens.$background-interactive-default;
$item-background-color-hover: tokens.$background-interactive-hover;
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/scss/tools/_form-fields.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

@mixin inline-field-root() {
display: inline-flex;
margin-block: form-fields-theme.$spacing;
margin-block: form-fields-theme.$padding;
cursor: cursors.$form-fields;
}

Expand Down Expand Up @@ -180,7 +180,7 @@

@mixin item() {
width: 100%;
padding: form-fields-theme.$item-spacing;
padding: form-fields-theme.$item-padding;
margin-block: 0;
border-radius: form-fields-theme.$item-border-radius;
background-color: form-fields-theme.$item-background-color-default;
Expand Down

0 comments on commit 245bad0

Please sign in to comment.