Skip to content

Commit

Permalink
Sass updates - fixed deprecated apis (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsnow301 authored Nov 10, 2024
1 parent b147479 commit 0453b1c
Show file tree
Hide file tree
Showing 51 changed files with 924 additions and 536 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"[yaml][markdown][html][scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.tsdk": "node_modules/typescript/lib"
}
}
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
ignores: ['dist/**', 'node_modules/**', 'pnpm-lock.yaml'],
ignores: ['dist/**', 'node_modules/**', 'pnpm-lock.yaml', 'lib/styles/**/*.d.ts'],
plugins: {
'simple-import-sort': simpleImportSort,
'unused-imports': unusedImports,
Expand Down
2 changes: 1 addition & 1 deletion lib/styles/atomic/color.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: MIT
*/

@use '../colors.scss';
@use '../colors';

$fg-map: colors.$fg-map !default;
$bg-map: colors.$bg-map !default;
Expand Down
2 changes: 1 addition & 1 deletion lib/styles/atomic/links.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '../colors.scss';
@use '../colors';

a {
&:link,
Expand Down
2 changes: 1 addition & 1 deletion lib/styles/atomic/outline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: MIT
*/

@use '../colors.scss';
@use '../colors';

.outline-dotted {
outline-style: dotted !important;
Expand Down
50 changes: 26 additions & 24 deletions lib/styles/colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* SPDX-License-Identifier: MIT
*/

@use "sass:color";
@use "sass:map";
@use "sass:meta";
@use 'sass:color';
@use 'sass:map';
@use 'sass:meta';

// Base colors
$black: #000000 !default;
Expand Down Expand Up @@ -45,25 +45,25 @@ $fg-lightness: 10% !default;
// Mappings of color names

$_gen_map: (
"black": $black,
"white": $white,
"red": $red,
"orange": $orange,
"yellow": $yellow,
"olive": $olive,
"green": $green,
"teal": $teal,
"blue": $blue,
"violet": $violet,
"purple": $purple,
"pink": $pink,
"brown": $brown,
"grey": $grey,
"light-grey": $light-grey,
"good": $good,
"average": $average,
"bad": $bad,
"label": $label,
'black': $black,
'white': $white,
'red': $red,
'orange': $orange,
'yellow': $yellow,
'olive': $olive,
'green': $green,
'teal': $teal,
'blue': $blue,
'violet': $violet,
'purple': $purple,
'pink': $pink,
'brown': $brown,
'grey': $grey,
'light-grey': $light-grey,
'good': $good,
'average': $average,
'bad': $bad,
'label': $label,
);

// Foreground color names for which to generate a color map
Expand All @@ -72,8 +72,9 @@ $fg-map-keys: map.keys($_gen_map) !default;
$bg-map-keys: map.keys($_gen_map) !default;

$fg-map: ();

@each $color-name in $fg-map-keys {
$fg-map: map-merge(
$fg-map: map.merge(
$fg-map,
(
$color-name: fg(map.get($_gen_map, $color-name)),
Expand All @@ -82,8 +83,9 @@ $fg-map: ();
}

$bg-map: ();

@each $color-name in $bg-map-keys {
$bg-map: map-merge(
$bg-map: map.merge(
$bg-map,
(
$color-name: bg(map.get($_gen_map, $color-name)),
Expand Down
4 changes: 2 additions & 2 deletions lib/styles/components/BlockQuote.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* SPDX-License-Identifier: MIT
*/

@use '../base.scss';
@use '../colors.scss';
@use '../base';
@use '../colors';

$color-default: colors.fg(colors.$label) !default;

Expand Down
6 changes: 3 additions & 3 deletions lib/styles/components/Button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* SPDX-License-Identifier: MIT
*/

@use '../base.scss';
@use '../colors.scss';
@use '../functions.scss' as *;
@use '../base';
@use '../colors';
@use '../functions' as *;

$color-default: colors.bg(colors.$primary) !default;
$color-disabled: #999999 !default;
Expand Down
60 changes: 29 additions & 31 deletions lib/styles/components/Button.module.scss.d.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,44 @@
declare const classNames: {
readonly button: "button";
readonly fa: "fa";
readonly fas: "fas";
readonly far: "far";
readonly dropdown: "dropdown";
readonly ellipsis: "ellipsis";
readonly fluid: "fluid";
readonly circular: "circular";
readonly color__average: "color__average";
readonly color__bad: "color__bad";
readonly compact: "compact";
readonly color__black: "color__black";
readonly color__white: "color__white";
readonly color__red: "color__red";
readonly color__orange: "color__orange";
readonly color__yellow: "color__yellow";
readonly color__olive: "color__olive";
readonly color__green: "color__green";
readonly color__teal: "color__teal";
readonly color__blue: "color__blue";
readonly color__violet: "color__violet";
readonly color__purple: "color__purple";
readonly color__pink: "color__pink";
readonly color__brown: "color__brown";
readonly color__caution: "color__caution";
readonly color__danger: "color__danger";
readonly color__default: "color__default";
readonly color__good: "color__good";
readonly color__green: "color__green";
readonly color__grey: "color__grey";
readonly color__label: "color__label";
readonly "color__light-grey": "color__light-grey";
readonly color__olive: "color__olive";
readonly color__orange: "color__orange";
readonly color__pink: "color__pink";
readonly color__purple: "color__purple";
readonly color__red: "color__red";
readonly color__teal: "color__teal";
readonly color__good: "color__good";
readonly color__average: "color__average";
readonly color__bad: "color__bad";
readonly color__label: "color__label";
readonly color__default: "color__default";
readonly color__caution: "color__caution";
readonly color__danger: "color__danger";
readonly color__transparent: "color__transparent";
readonly color__violet: "color__violet";
readonly color__white: "color__white";
readonly color__yellow: "color__yellow";
readonly compact: "compact";
readonly content: "content";
readonly disabled: "disabled";
readonly dropdown: "dropdown";
readonly ellipsis: "ellipsis";
readonly fa: "fa";
readonly far: "far";
readonly fas: "fas";
readonly selected: "selected";
readonly flex: "flex";
readonly flex__fluid: "flex__fluid";
readonly fluid: "fluid";
readonly hasContent: "hasContent";
readonly iconPosition__right: "iconPosition__right";
readonly selected: "selected";
readonly textMargin: "textMargin";
readonly verticalAlignContent__bottom: "verticalAlignContent__bottom";
readonly verticalAlignContent__middle: "verticalAlignContent__middle";
readonly verticalAlignContent__top: "verticalAlignContent__top";
readonly verticalAlignContent__middle: "verticalAlignContent__middle";
readonly verticalAlignContent__bottom: "verticalAlignContent__bottom";
readonly content: "content";
readonly textMargin: "textMargin";
};
export = classNames;
2 changes: 1 addition & 1 deletion lib/styles/components/Divider.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: MIT
*/

@use '../base.scss';
@use '../base';

$color: rgba(255, 255, 255, 0.1) !default;
$thickness: base.em(2px) !default;
Expand Down
2 changes: 1 addition & 1 deletion lib/styles/components/Divider.module.scss.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
declare const classNames: {
readonly hidden: "hidden";
readonly horizontal: "horizontal";
readonly hidden: "hidden";
readonly vertical: "vertical";
};
export = classNames;
2 changes: 1 addition & 1 deletion lib/styles/components/Dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: MIT
*/

@use '../base.scss';
@use '../base';

.Dropdown {
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions lib/styles/components/Icon.module.scss.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare const classNames: {
readonly icon: 'icon';
readonly iconStack: 'iconStack';
readonly iconStack: "iconStack";
readonly icon: "icon";
};
export = classNames;
26 changes: 20 additions & 6 deletions lib/styles/components/ImageButton.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* @license MIT
*/

@use '../base.scss';
@use '../colors.scss';
@use '../functions.scss' as *;
@use '../base';
@use '../colors';
@use '../functions' as *;

$color-default: colors.bg(base.$color-bg-section) !default;
$color-disabled: #631d1d !default;
Expand Down Expand Up @@ -47,7 +47,12 @@ $bg-map: colors.$bg-map !default;
}

.contentColor__#{$color-name} {
@include button-style($color-value, $border-color: lighten($color-value, 25%), $opacity: 1, $hoverable: false);
@include button-style(
$color-value,
$border-color: lighten($color-value, 25%),
$opacity: 1,
$hoverable: false
);
}

.buttonsContainerColor__#{$color-name} {
Expand All @@ -71,7 +76,11 @@ $bg-map: colors.$bg-map !default;
}

.selected {
@include button-style($color-selected, $border-color: rgba($color-selected, 0.25), $border-width: 1px);
@include button-style(
$color-selected,
$border-color: rgba($color-selected, 0.25),
$border-width: 1px
);
}

.contentColor__default {
Expand All @@ -89,7 +98,12 @@ $bg-map: colors.$bg-map !default;
}

.contentSelected {
@include button-style($color-selected, $border-color: lighten($color-selected, 25%), $opacity: 1, $hoverable: false);
@include button-style(
$color-selected,
$border-color: lighten($color-selected, 25%),
$opacity: 1,
$hoverable: false
);
}

.buttonsContainerColor__default {
Expand Down
Loading

0 comments on commit 0453b1c

Please sign in to comment.