Skip to content

830-refactor: Move style params to scss variables #891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/app/docs/components/docs-layout/docs-layout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
overflow-y: initial;
display: flex;
flex-direction: column;
gap: 20px;
gap: $gap-m;

height: initial;
}
Expand All @@ -40,7 +40,7 @@
.docs-content {
display: flex;
flex-direction: column;
gap: 50px;
gap: $gap-xxxl;

width: 100%;
min-width: 0;
Expand All @@ -59,7 +59,7 @@
align-items: center;

@include media-mobile-landscape {
gap: 20px;
gap: $gap-m;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/docs/components/docs-menu/docs-menu.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

padding-left: 12px;

font-size: 14px;
font-size: $font-size-xs;
text-align: left;
list-style-type: none;

Expand Down
2 changes: 1 addition & 1 deletion src/app/docs/components/search/search.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@
}

.subresult p {
font-size: 14px;
font-size: $font-size-xs;
}
25 changes: 25 additions & 0 deletions src/core/styles/_constants.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,28 @@ $ease-standard-accelerate: cubic-bezier(0.3, 0, 1, 1);
$ease-emphasize-decelerate: cubic-bezier(0, 0, 0, 1);
$ease-in-cubic: cubic-bezier(0.32, 0, 0.67, 0);
$standard-decelerate: cubic-bezier(0, 0, 0, 1);

// Border radius
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add $border-radius-xxs: 4px;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it. But I'm not sure about the names of z-indexes though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it. But I'm not sure about the names of z-indexes though.

In our project we have -1, 1, 2, 10/100. Maybe:
-1 - bottom,
1 - default,
2 - top,
10/100 - max

@SpaNb4 @Quiddlee what do you think, guys?

Copy link
Collaborator

@SpaNb4 SpaNb4 Jun 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ansivgit, I think we could use something similar to:
https://www.smashingmagazine.com/2021/02/css-z-index-large-projects/
image

As alternatives to bottom and top

Also, shouldn't the default be 0?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ansivgit, I think we could use something similar to: https://www.smashingmagazine.com/2021/02/css-z-index-large-projects/ image

As alternatives to bottom and top

Also, shouldn't the default be 0?

I like it! And I just suggest to add max = 999

$border-radius-xs: 8px;
$border-radius-s: 12px;
$border-radius-m: 16px;
$border-radius-l: 20px;
$border-radius-xxxl: 999px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to change it to $border-radius-max


// Font sizes
$font-size-xxs: 12px;
$font-size-xs: 14px;
$font-size-s: 16px;
$font-size-m: 18px;
$font-size-l: 20px;
$font-size-xl: 24px;
$font-size-xxl: 36px;

// Gap
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Gap
// Standard gap

$gap-xs: 8px;
$gap-s: 16px;
$gap-m: 20px;
$gap-l: 24px;
$gap-xl: 32px;
$gap-xxl: 40px;
$gap-xxxl: 50px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SpaNb4 @Quiddlee Guys, what do you think - shouldn't we use sizes that are multiples of 4px? And change 50px to 48px?

4 changes: 2 additions & 2 deletions src/core/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ figure {

height: var(--slider-arrow-btn-height);
margin: 2px;
border-radius: 8px;
border-radius: $border-radius-xs;

opacity: $opacity-100;
backdrop-filter: blur(20px);
Expand Down Expand Up @@ -205,7 +205,7 @@ figure {
width: 100%;
height: 100%;

font-size: 24px;
font-size: $font-size-xl;
color: $color-white;

background: $color-gray-400;
Expand Down
14 changes: 7 additions & 7 deletions src/entities/course/ui/course-card/course-card.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

min-width: 100px;
height: 100%;
border-radius: 12px;
border-radius: $border-radius-s;

&::before {
content: '';
Expand All @@ -33,13 +33,13 @@

overflow: hidden;
display: flex;
gap: 16px;
gap: $gap-s;
align-items: center;

height: 100%;
min-height: 112px;
padding: 36px 32px;
border-radius: 12px 12px 0 0;
border-radius: $border-radius-s $border-radius-s 0 0;

background-color: $color-purple-50;

Expand All @@ -57,15 +57,15 @@

.course-info {
display: flex;
gap: 16px;
gap: $gap-s;
align-items: center;
justify-content: space-between;

padding: 32px;
border-color: $color-gray-200;
border-style: solid;
border-width: 0 1px 1px 1px;
border-radius: 0 0 12px 12px;
border-radius: 0 0 $border-radius-s $border-radius-s;

background-color: $color-white;

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

.course-info {
padding: 24px;
font-size: 14px;
font-size: $font-size-xs;

@include media-laptop-medium {
flex-direction: row;
Expand All @@ -117,7 +117,7 @@
.course-link {
gap: 4px;
padding: 10px 12px;
font-size: 14px;
font-size: $font-size-xs;
}

section {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
.course-info {
display: flex;
flex-direction: column;
gap: 8px;
gap: $gap-xs;

width: 100%;

Expand Down
12 changes: 6 additions & 6 deletions src/entities/event/ui/event-card/event-card.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

width: 320px;
padding: 0;
border-radius: 12px;
border-radius: $border-radius-s;

.card-header {
position: relative;
Expand All @@ -16,7 +16,7 @@
padding: 32px 24px 24px 24px;
border: solid $color-gray-200;
border-width: 1px 1px 0 1px;
border-radius: 12px 12px 0 0;
border-radius: $border-radius-s $border-radius-s 0 0;

background-color: $color-purple-50;

Expand All @@ -38,7 +38,7 @@
border: 4px solid $color-purple-100;
border-radius: 36px;

font-size: 16px;
font-size: $font-size-s;
line-height: 1.2;
}

Expand Down Expand Up @@ -73,7 +73,7 @@
margin-top: 0;
margin-bottom: 8px;

font-size: 16px;
font-size: $font-size-s;
text-overflow: ellipsis;
white-space: nowrap;
}
Expand All @@ -92,7 +92,7 @@
padding: 24px;
border: solid $color-gray-200;
border-width: 0 1px 1px 1px;
border-radius: 0 0 12px 12px;
border-radius: 0 0 $border-radius-s $border-radius-s;

background-color: hsla(from $color-gray-100 h s l/ $opacity-20);

Expand All @@ -104,7 +104,7 @@

margin-bottom: 16px;

font-size: 14px;
font-size: $font-size-xs;
font-weight: $font-weight-medium;
color: $color-gray-500;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.card {
display: flex;
flex-direction: column;
gap: 24px;
gap: $gap-l;
}

.card-wrapper {
max-width: 624px;
min-height: 510px;
padding: 40px 32px 40px 32px;
border-radius: 12px;
border-radius: $border-radius-s;

box-shadow: 0 4px 12px 0 hsla(from $color-black h s l / $opacity-10);

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

.card-info {
display: flex;
gap: 24px;
gap: $gap-l;
align-items: center;
}

Expand All @@ -54,7 +54,7 @@
.card-content-wrapper {
display: flex;
flex-direction: column;
gap: 24px;
gap: $gap-l;
align-items: flex-start;
}

Expand Down
10 changes: 5 additions & 5 deletions src/entities/trainer/ui/trainers-card/trainer-card.module.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.trainer-card {
display: flex;
gap: 24px;
gap: $gap-l;
align-items: flex-start;
justify-content: space-between;

max-width: 700px;
padding: 40px 32px 40px 32px;
border-radius: 16px;
border-radius: $border-radius-m;

box-shadow: 0 4px 16px 0 rgb(0 0 0 / 12%);

Expand All @@ -17,7 +17,7 @@
img {
width: 100%;
height: auto;
border-radius: 12px;
border-radius: $border-radius-s;
}
}

Expand All @@ -31,13 +31,13 @@

.card-subtitle {
margin: 0;
font-size: 18px;
font-size: $font-size-m;
line-height: 1.15;
color: $color-gray-500;
}

.card-content {
font-size: 16px;
font-size: $font-size-s;
font-weight: $font-weight-regular;
line-height: 24px;
}
Expand Down
4 changes: 2 additions & 2 deletions src/shared/ui/date-simple/date-simple.module.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.date {
display: flex;
gap: 8px;
gap: $gap-xs;
align-items: center;
justify-content: flex-start;

margin: 0;

font-size: 14px;
font-size: $font-size-xs;
}

.icon {
Expand Down
10 changes: 5 additions & 5 deletions src/shared/ui/link-custom/link-custom.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

display: flex;
flex-flow: row nowrap;
gap: 8px;
gap: $gap-xs;
place-content: center center;
align-items: center;

Expand All @@ -19,7 +19,7 @@
padding: 12px 24px;
border: 1px solid $color-black;

font-size: 18px;
font-size: $font-size-m;
color: $color-black;

.icon-wrapper {
Expand All @@ -41,7 +41,7 @@
padding: 16px 24px;
border: 2px solid $color-black;

font-size: 18px;
font-size: $font-size-m;
line-height: 24px;
color: $color-white;

Expand All @@ -61,9 +61,9 @@
width: max-content;
height: 36px;
padding: 10px 12px;
border-radius: 9999px;
border-radius: $border-radius-xxxl;

font-size: 14px;
font-size: $font-size-xs;
line-height: 16px;
color: $color-black;

Expand Down
8 changes: 4 additions & 4 deletions src/shared/ui/list/list.module.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.list {
display: flex;
flex-direction: column;
gap: 8px;
gap: $gap-xs;

font-size: 18px;
font-size: $font-size-m;
line-height: 28px;
letter-spacing: 0.5px;
list-style-type: none;
Expand All @@ -13,7 +13,7 @@
letter-spacing: 0;

@include media-laptop {
font-size: 16px;
font-size: $font-size-s;
line-height: 24px;
}
}
Expand All @@ -23,6 +23,6 @@
}

@include media-tablet-large {
font-size: 16px;
font-size: $font-size-s;
}
}
2 changes: 1 addition & 1 deletion src/shared/ui/main-title/main-title.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

@include media-tablet {
padding-bottom: 16px;
font-size: 36px;
font-size: $font-size-xxl;
line-height: 44px;
}
}
Expand Down
Loading
Loading