Skip to content

Commit

Permalink
chore(stack): removed mixins, created new tokens for justify and alig…
Browse files Browse the repository at this point in the history
…nment
  • Loading branch information
nickonometry committed Feb 22, 2024
1 parent f496f14 commit 30284e2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 deletions.
2 changes: 2 additions & 0 deletions src/lib/core/styles/tokens/stack/_tokens.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ $tokens: (
gap: utils.module-val(stack, gap, 16px),
height: utils.module-val(stack, height, null),
stretch: utils.module-val(stack, stretch, initial),
alignment: utils.module-val(stack, alignment, normal),
justify: utils.module-val(stack, justify, normal),
wrap: utils.module-val(stack, wrap, wrap),
) !default;

Expand Down
26 changes: 2 additions & 24 deletions src/lib/stack/_core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
@mixin base() {
display: flex;
flex-direction: column;
align-items: #{token(alignment)};
justify-content: #{token(justify)};
gap: #{token(gap)};
height: #{token(height)};
width: 100%;
Expand All @@ -19,28 +21,4 @@

@mixin wrap() {
flex-wrap: wrap;
}

@mixin justify-start() {
justify-content: start;
}

@mixin justify-center() {
justify-content: center;
}

@mixin justify-end() {
justify-content: end;
}

@mixin align-start() {
align-items: start;
}

@mixin align-center() {
align-items: center;
}

@mixin align-end() {
align-items: end;
}
13 changes: 6 additions & 7 deletions src/lib/stack/stack.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,36 @@

:host([alignment=start]) {
.forge-stack {
//override stretch css prop
@include align-start;
@include override(alignment, start, value);
}
}

:host([alignment=center]) {
.forge-stack {
@include align-center;
@include override(alignment, center, value);
}
}

:host([alignment=end]) {
.forge-stack {
@include align-end;
@include override(alignment, end, value);
}
}

:host([justify=start]) {
.forge-stack {
@include justify-start;
@include override(justify, start, value);
}
}

:host([justify=center]) {
.forge-stack {
@include justify-center;
@include override(justify, center, value);
}
}

:host([justify=end]) {
.forge-stack {
@include justify-end;
@include override(justify, end, value);
}
}

0 comments on commit 30284e2

Please sign in to comment.