Skip to content

Commit

Permalink
feat: add css variables
Browse files Browse the repository at this point in the history
  • Loading branch information
NasgulNexus committed Dec 18, 2024
1 parent fa43e25 commit 7b48038
Show file tree
Hide file tree
Showing 50 changed files with 865 additions and 563 deletions.
580 changes: 580 additions & 0 deletions docs/styles.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/lib/core/components/Form/hooks/useSearch/useSearch.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@import '../../../../../kit/styles/variables.scss';

.#{$ns}use-search {
margin-bottom: $df-offset-15;
margin-bottom: var(--df-spacing-inputs, $df-spacing-inputs);

&_hidden {
display: none;
}

&:last-child {
margin-bottom: var(--g-spacing-0);
margin-bottom: var(--df-spacing-last-child, $df-spacing-last-child);
}
}
19 changes: 10 additions & 9 deletions src/lib/kit/components/AccordeonCard/AccordeonCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
justify-content: space-between;
box-sizing: border-box;
box-shadow: 0 1px 5px var(--g-color-sfx-shadow);
border-radius: $df-border-radius-xs;
border-radius: var(--df-accordeon-card-border-radius, $df-border-radius-xs);
color: var(--g-color-text-primary);
background-color: var(--g-color-base-float);

.#{$ns}row {
width: 100%;
width: var(--df-accordeon-card-row-width, 100%);
max-width: unset;

.#{$ns}select,
Expand All @@ -22,15 +23,15 @@

.#{$ns}monaco-input,
.#{$ns}monaco-base-view {
width: 100%;
width: var(--df-accordeon-card-monaco-input-width, 100%);
}

&:hover {
box-shadow: 0 3px 10px var(--g-color-sfx-shadow);
}

&:last-child {
margin-bottom: var(--g-spacing-0);
margin-bottom: var(--df-spacing-last-child, $df-spacing-last-child);
}

&_empty {
Expand All @@ -48,8 +49,8 @@
display: flex;
position: relative;
box-sizing: border-box;
width: 100%;
padding: var(--g-spacing-4);
width: var(--df-accordeon-card-header-width, 100%);
padding: var(--df-accordeon-card-header-padding, var(--g-spacing-4));

&:hover {
cursor: pointer;
Expand Down Expand Up @@ -78,7 +79,7 @@
}

&-content-description {
margin-top: var(--g-spacing-3);
margin-top: var(--df-accordeon-card-content-description-margin-top, var(--g-spacing-3));
color: var(--g-color-text-complementary);
}

Expand All @@ -90,7 +91,7 @@
}

&__interal-actions {
margin-right: $df-offset-5;
margin-right: var(--df-accordeon-card-interal-actions-margin-right, $df-offset-5);
}

&__toggle-icon_open {
Expand All @@ -99,7 +100,7 @@

&__body {
display: none;
padding: var(--g-spacing-4);
padding: var(--df-accordeon-card-body-padding, var(--g-spacing-4));

&_open {
display: block;
Expand Down
27 changes: 14 additions & 13 deletions src/lib/kit/components/Card/Card.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
@import '../../styles/variables.scss';

.#{$ns}card {
--_--title-max-width: 533px;

margin-bottom: var(--g-spacing-5);
margin-bottom: var(--df-spacing-inputs-section, $df-spacing-inputs-section);

&:last-child {
margin-bottom: var(--g-spacing-0);
margin-bottom: var(--df-spacing-last-child, $df-spacing-last-child);
}

.#{$ns}row {
width: 100%;
width: var(--df-card-row-width, 100%);
max-width: unset;

.#{$ns}select,
Expand All @@ -22,7 +20,7 @@

.#{$ns}monaco-input,
.#{$ns}monaco-base-view {
width: 100%;
width: var(--df-card-monaco-input-width, 100%);
}

&_empty-body {
Expand All @@ -43,7 +41,7 @@
display: flex;
justify-content: space-between;
align-items: center;
padding: var(--g-spacing-5);
padding: var(--df-card-header-padding, var(--g-spacing-5));

&_interactive {
cursor: pointer;
Expand All @@ -61,21 +59,21 @@
align-items: center;

& > * {
margin-left: $df-offset-10;
margin-left: var(--df-card-header-right-child-margin-left, $df-offset-10);
}
}

&__title {
max-width: var(--df-card-title-max-width, var(--_--title-max-width));
height: 20px;
max-width: var(--df-card-title-max-width, 533px);
height: var(--df-card-title-height, var(--g-spacing-5));
}

&__title-popover {
height: 20px;
height: var(--df-card-title-popover-height, var(--g-spacing-5));
}

&__note {
margin-left: $df-offset-5;
margin-left: var(--df-card-note-margin-left, $df-offset-5);

.gc-help-popover {
display: flex;
Expand All @@ -94,7 +92,10 @@

&__body {
display: none;
padding: 0 var(--g-spacing-5) var(--g-spacing-5);
padding: var(
--df-card-body-padding,
var(--g-spacing-0) var(--g-spacing-5) var(--g-spacing-5)
);

&_open {
display: block;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/kit/components/ErrorWrapper/ErrorWrapper.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '../../styles/variables.scss';

.#{$ns}error-wrapper {
width: 100%;
width: var(--df-error-wrapper-width, 100%);

&_error {
.yc-select-control:not(.#{$ns}error-wrapper-ignore),
Expand Down Expand Up @@ -29,7 +29,7 @@

&__error-text {
color: var(--g-color-text-danger);
margin-top: 2px;
margin-top: var(--df-error-wrapper-error-text-margin-top, var(--g-spacing-half));
font-size: var(--g-text-body-1-font-size);
line-height: var(--g-text-body-1-line-height);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../../styles/variables';

.#{$ns}generate-random-value-button {
margin-left: 8px;
margin-left: var(--df-generate-random-value-button-margin-left, var(--g-spacing-2));
}
20 changes: 13 additions & 7 deletions src/lib/kit/components/GroupIndent/GroupIndent.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
@import '../../styles/variables.scss';

.#{$ns}group-indent {
padding-top: $df-offset-11;
padding-left: var(--g-spacing-5);
margin-top: -$df-offset-11;
margin-bottom: var(--g-spacing-5);
margin-left: $df-offset-5;
padding: var(
--df-group-indent-padding,
$df-offset-11 var(--g-spacing-0) var(--g-spacing-0) var(--g-spacing-5)
);
margin: var(
--df-group-indent-margin,
-$df-offset-11 var(--g-spacing-0) var(--g-spacing-0) $df-offset-5
);
border-left: 1px solid var(--g-color-line-generic-accent);

&:last-child {
margin-bottom: var(--g-spacing-0);
margin-bottom: var(--df-spacing-last-child, $df-spacing-last-child);
}

&:empty {
display: none;
}

& > .#{$ns}simple-vertical-accordeon_view {
margin-top: -$df-offset-10;
margin-top: var(
--df-group-indent-simple-vertical-accordeon-view-margin-top,
-$df-offset-10
);
}
}
12 changes: 7 additions & 5 deletions src/lib/kit/components/Inputs/ArrayBase/ArrayBase.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

&__items-wrapper {
&_add-button-down {
margin-bottom: $df-offset-15;
margin-bottom: var(--df-spacing-inputs, $df-spacing-inputs);
}

&_items-primitive {
min-width: 100%;
min-width: var(--df-array-base-items-primitive-min-width, 100%);

&:empty {
min-width: unset;
Expand All @@ -25,13 +25,15 @@
}

&__item-prefix {
margin-top: -$df-offset-7;
margin-bottom: var(--g-spacing-2);
margin: var(
--df-array-base-item-prefix-margin,
-$df-offset-7 var(--g-spacing-0) var(--g-spacing-2)
);
}

&__add-button {
&_right {
margin-left: var(--g-spacing-1);
margin-left: var(--df-array-base-add-button-right-margin-left, var(--g-spacing-1));
}
}
}
2 changes: 1 addition & 1 deletion src/lib/kit/components/Inputs/Checkbox/Checkbox.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '../../../styles/variables';

.#{$ns}checkbox {
height: 28px;
height: var(--df-checkbox-height, $df-checkbox-height);
display: flex;
align-items: center;
}
12 changes: 7 additions & 5 deletions src/lib/kit/components/Inputs/CheckboxGroup/CheckboxGroup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
.#{$ns}checkbox-group {
display: flex;
align-items: center;
height: 28px;
height: var(--df-checkbox-height, $df-checkbox-height);

& > *:not(:last-child) {
margin-right: $df-offset-6;
margin-right: var(--df-checkbox-group-child-margin-right, $df-offset-6);
}

&_vertical {
flex-direction: column;
align-items: flex-start;
margin-top: var(--g-spacing-2);
margin-top: var(--df-checkbox-group-vertical-margin-top, var(--g-spacing-2));
height: auto;

& > *:not(:last-child) {
margin-right: var(--g-spacing-0);
margin-bottom: $df-offset-6;
margin: var(
--df-checkbox-group-vertical-child-margin,
var(--g-spacing-0) var(--g-spacing-0) $df-offset-6
);
}
}
}
2 changes: 1 addition & 1 deletion src/lib/kit/components/Inputs/DateInput/DateInput.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../../../styles/variables';

.#{$ns}date-input {
width: 100%;
width: var(--df-date-input-width, 100%);
}
6 changes: 2 additions & 4 deletions src/lib/kit/components/Inputs/FileInput/FileInput.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
@import '../../../styles/variables.scss';

.#{$ns}file-input {
--_--file-name-max-width: 160px;

display: flex;

&__input {
Expand All @@ -11,7 +9,7 @@

&__file-name {
display: block;
margin: auto $df-offset-10;
max-width: var(--df-file-input-file-name-max-width, var(--_--file-name-max-width));
margin: var(--df-file-input-file-name-margin, auto $df-offset-10);
max-width: var(--df-file-input-file-name-max-width, 160px);
}
}
4 changes: 2 additions & 2 deletions src/lib/kit/components/Inputs/MonacoInput/MonacoHeader.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@import '../../../styles/variables.scss';

.#{$ns}monaco-header {
height: 52px;
height: var(--df-monaco-header-height, 52px);
display: flex;
justify-content: space-between;
padding: $df-offset-3;
padding: var(--df-monaco-header-padding, $df-offset-15);
align-items: center;
background-color: var(--g-color-base-float-hover);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.#{$ns}monaco-input {
// TODO: Remove this styles
width: 550px;
width: var(--df-monaco-input-width, 550px);

&__container {
border: 1px solid var(--g-color-line-generic);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

.#{$ns}monaco-input-dialog {
.g-dialog-footer {
padding: $df-offset-6 var(--g-spacing-8) var(--g-spacing-8);
padding: var(
--df-monaco-input-dialog-dialog-footer-padding,
$df-offset-6 var(--g-spacing-8) var(--g-spacing-8)
);
}

&__container {
Expand All @@ -11,7 +14,7 @@

&__dialog-header {
.g-dialog-header__caption {
min-height: 24px;
min-height: var(--df-monaco-dialog-header-caption-min-height, 24px);
}
}
}
10 changes: 4 additions & 6 deletions src/lib/kit/components/Inputs/MultiOneOf/MultiOneOf.scss
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
@import '../../../styles/variables';

.#{$ns}multi-oneof {
--_--select-max-width: 305px;

&__select {
max-width: var(--df-multi-oneof-max-width-select, var(--_--select-max-width));
max-width: var(--df-multi-oneof-select-max-width, 305px);
}

&__content {
&_flat {
& > .#{$ns}group-indent {
margin: var(--g-spacing-0);
margin: var(--df-multi-oneof-content-flat-margin, var(--g-spacing-0));
border-left: none;
padding: var(--g-spacing-0);
padding: var(--df-multi-oneof-content-flat-padding, var(--g-spacing-0));

& > .#{$ns}use-search {
margin-top: $df-offset-15;
margin-top: var(--df-spacing-inputs, $df-spacing-inputs);

&:empty {
display: none;
Expand Down
Loading

0 comments on commit 7b48038

Please sign in to comment.