This repository has been archived by the owner on Feb 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(mixins): export mixins * refactor: remove redundant mixins * docs: restructure mixins list in README
- Loading branch information
Showing
5 changed files
with
155 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
@import "mixins/common"; | ||
@import "mixins/states"; | ||
@import "mixins/typography"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
$expand-animation-timing: cubic-bezier(0, 0, 0.35, 1); | ||
|
||
// Grid auto fit sizes | ||
$grid-auto-fit-cell-width-small: 120px; | ||
$grid-auto-fit-cell-width-medium: 180px; | ||
$grid-auto-fit-cell-width-large: 240px; | ||
$grid-auto-fit-cell-width-xl: 300px; | ||
|
||
@mixin hidden-element() { | ||
opacity: 0; | ||
width: 0; | ||
height: 0; | ||
position: absolute; | ||
} | ||
|
||
// Grid auto fit | ||
// - This mixin defines a grid with auto fit repeat cells using min-max funtion. | ||
// -- This allows grid to accommodate container width without media queries. | ||
// -- it uses a repeat grid function with auto fix and minmax. | ||
// -- grid adaptation is due to the min value along with auto-fit and 1fr max value. | ||
|
||
// @params: | ||
// - $grid-gap: null , defines grid "gap" attribute. | ||
// - $grid-column-gap: null, defines grid "column-gap" attribute. | ||
// - $grid-row-gap: null, defines grid "row-gap" attribute. | ||
// - $grid-cell-min-width: {mandatory}, defined min value in for grid-template-columns | ||
// - $grid-cell-array-calc: {mandatory}, defined max num of items using calc | ||
|
||
@mixin grid-auto-fit( | ||
$grid-gap: null, | ||
$grid-column-gap: null, | ||
$grid-row-gap: null, | ||
$grid-cell-min-width, | ||
$grid-cell-array-calc: null, | ||
$important: false | ||
) { | ||
display: grid; | ||
@if $important { | ||
grid-template-columns: repeat( | ||
auto-fit, | ||
minmax(clamp(#{$grid-cell-array-calc}, #{$grid-cell-min-width}, 100%), 1fr) | ||
) !important; | ||
gap: $grid-gap !important; | ||
column-gap: $grid-column-gap !important; | ||
row-gap: $grid-row-gap !important; | ||
} @else { | ||
grid-template-columns: repeat( | ||
auto-fit, | ||
minmax(clamp(#{$grid-cell-array-calc}, #{$grid-cell-min-width}, 100%), 1fr) | ||
); | ||
gap: $grid-gap; | ||
column-gap: $grid-column-gap; | ||
row-gap: $grid-row-gap; | ||
} | ||
} | ||
|
||
@mixin scroller($width: 4px, $height: 6px, $color: var(--ui-border-color)) { | ||
&::-webkit-scrollbar { | ||
width: $width; | ||
height: $height; | ||
} | ||
|
||
&::-webkit-scrollbar-thumb { | ||
background-color: $color; | ||
border-radius: 4px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
@mixin disabled { | ||
border-color: var(--disabled-background-color); | ||
color: var(--disabled-text-color); | ||
cursor: not-allowed; | ||
|
||
&:hover { | ||
background-color: transparent; | ||
} | ||
} | ||
|
||
@mixin reset-button { | ||
border: none; | ||
margin: 0; | ||
padding: 0; | ||
width: auto; | ||
overflow: visible; | ||
background: transparent; | ||
|
||
/* inherit font & color from ancestor */ | ||
color: inherit; | ||
font: inherit; | ||
|
||
/* Normalize `line-height`. Cannot be changed from `normal` in Firefox 4+. */ | ||
line-height: normal; | ||
|
||
/* Corrects font smoothing for webkit */ | ||
-webkit-font-smoothing: inherit; | ||
-moz-osx-font-smoothing: inherit; | ||
|
||
/* Corrects inability to style clickable `input` types in iOS */ | ||
appearance: none; | ||
|
||
@include focus-style; | ||
} | ||
|
||
@mixin focus-style($focus-radius: 4px) { | ||
&:focus-visible, | ||
&.focus-visible { | ||
outline: none; | ||
z-index: 11; | ||
border-radius: $focus-radius; | ||
box-shadow: 0 0 0 3px hsl(209deg 100% 50% / 50%), 0 0 0 1px var(--primary-hover-color) inset; | ||
} | ||
|
||
&:focus:not(.focus-visible) { | ||
outline: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters