Skip to content

Commit

Permalink
switching to static colors again and changing design of icon to diff …
Browse files Browse the repository at this point in the history
…to icon buttons
  • Loading branch information
nicosammito committed Dec 20, 2023
1 parent ccf5009 commit 12acddb
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 71 deletions.
12 changes: 6 additions & 6 deletions src/components/alert/Alert.style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
margin-bottom: 1rem;
min-height: 1.5rem;


&__heading {
font-weight: 500;
}
Expand All @@ -30,17 +29,18 @@
}

&__icon {
@include box(false);
display: flex;
justify-content: center;
align-items: center;
text-align: center;
padding: .25rem;
color: color($white);
width: 1.25rem;
height: 1.25rem;
margin-right: .5rem;

> * {
width: 1rem;
height: 1rem;
width: 1.25rem;
height: 1.25rem;
}
}

Expand All @@ -67,7 +67,7 @@
@include box(false, $color);

.alert__icon {
@include box(false, $color);
color: color($color);
}

.alert__content {
Expand Down
19 changes: 7 additions & 12 deletions src/components/button/Button.style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
margin-bottom: 1rem;
width: fit-content;

&--disabled {
opacity: 50%;
pointer-events: none;
}
@include disabled;

&__icon + &__content {
margin-left: .5rem;
Expand All @@ -22,19 +19,17 @@
}

&__icon {
@include box(false);

display: inline-flex;
justify-content: center;
align-items: center;
width: 1rem;
height: 1rem;
padding: .25rem;
width: 1.25rem;
height: 1.25rem;
color: color($white);
cursor: pointer;

> * {
width: 1rem;
height: 1rem;
width: 1.25rem;
height: 1.25rem;
}
}
}
Expand All @@ -44,7 +39,7 @@
@include box(true, $color);

.button__icon {
@include box(false, $color);
color: color($color);
}

}
Expand Down
4 changes: 2 additions & 2 deletions src/components/card/Card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ export const Test = () => {
</ListGroup>
<CardFooter>
<ButtonGroup>
<Button>
<Button variant={"secondary"}>
Button
</Button>
<Button>
<Button variant={"secondary"}>
Button
</Button>
</ButtonGroup>
Expand Down
4 changes: 1 addition & 3 deletions src/components/dropdown/Dropdown.style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@
border-top: 1px solid borderColor();
border-bottom: 1px solid borderColor();

@include hoverAndActiveContent {
background: rgba($color, .1);
}
@include background($color, true);

&:first-of-type {
border-top: none;
Expand Down
40 changes: 5 additions & 35 deletions src/components/input/Input.style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
margin-bottom: 0;
}

&--disabled {
pointer-events: none;
opacity: 50%;
}
@include disabled;

&__control {
display: flex;
Expand Down Expand Up @@ -48,21 +45,18 @@
}

&__icon {
@include box(false);

display: flex;
width: 1rem;
height: auto;
width: 1.25rem;
height: 1.25rem;
justify-content: center;
align-items: center;
aspect-ratio: 50/50;
padding: .25rem;
margin-left: .5rem;
pointer-events: none;

> * {
width: 1rem;
height: 1rem;
width: 1.25rem;
height: 1.25rem;
}

}
Expand Down Expand Up @@ -110,18 +104,6 @@

&--not-valid {

.input__control {
border-color: borderColor(false);

@include hoverAndActiveContent {
border-color: borderColor(true);
}

@include activeContent {
outline-color: $error;
}
}

.input__message {
display: block;
background: rgba($error, .1);
Expand All @@ -131,18 +113,6 @@

&--valid {

.input__control {
border-color: borderColor(false);

@include hoverAndActiveContent {
border-color: borderColor(true);
}

@include activeContent {
outline-color: $success;
}
}

.input__message {
display: block;
background: rgba($success, .1);
Expand Down
53 changes: 40 additions & 13 deletions src/styles/_helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,17 @@

@mixin box($active: true, $color: $secondary) {

background: rgba($color, 10%);
background: mix($bodyBg, $color, 90%);
@include border($active);
border-radius: $borderRadius;
color: rgba($white, .5);
font-family: Ubuntu, sans-serif;
font-size: $secondaryFontSize;
-webkit-backdrop-filter: blur($borderRadius * 2);
backdrop-filter: blur($borderRadius * 2);
border: 1px solid borderColor();
position: relative;

@if ($active == true) {
@include hoverAndActiveContent {
border: 1px solid borderColor(true);
}

@include activeContent {
outline: 1px solid $info;
outline-offset: 2px;
background: mix($bodyBg, if($color == $primary, $white, $color), if($color == $primary, 95%, 85%));
}
}
}
Expand All @@ -32,11 +25,45 @@
}

@mixin activeContent() {
&--active {
&:active, &--active {
@content
}
}

@function borderColor($hover: false) {
@return rgba($white, if($hover, 0.2, 0.1))
@function borderColor($interacted: false) {
@return rgba($white, if($interacted == true, .2, .1))
}

@mixin border($interact: true) {

border: 1px solid borderColor();

@if ($interact == true) {
&:active, &--active {
border: 1px solid borderColor(true);
}
}
}

@function color($color, $opacity: 0.5) {
@return rgba(if($color == $primary, $white, $color), $opacity)
}

@mixin background($color: $primary, $interact: true) {
background: mix($bodyBg, $color, 90%);

@if ($interact == true) {
&:hover, &:active, &--active {
background: mix($bodyBg, if($color == $primary, $white, $color), if($color == $primary, 95%, 85%));
}
}
}

@mixin disabled {

&--disabled {
opacity: 50%;
pointer-events: none;
}

}

0 comments on commit 12acddb

Please sign in to comment.