Skip to content

Commit

Permalink
feat(icons): moving icon styles support to icons package
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Mar 13, 2024
1 parent 7ff455b commit 37c7c5d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
5 changes: 1 addition & 4 deletions .storybook/theme/markdown-elements.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@use '@covalent/tokens' as tokens;
@use '../../libs/components/src/theme' as theme;
@use '../../libs/components/src/data-table/data-table.theme' as data-table;
@use '../../libs/components/src/icon/icon.theme' as icon;

$theme-tokens: map-get(tokens.$tokens, 'theme');
$light-tokens: map-get($theme-tokens, 'light');
Expand All @@ -12,8 +11,6 @@ $dark-colors: map-get($dark-tokens, 'colors');
$light-colors: map-merge($light-colors, map-get(tokens.$tokens, light));
$dark-colors: map-merge($dark-colors, map-get(tokens.$tokens, dark));

@include icon.core-styles();

// For convience re-define theme tokens scoped to a light/dark class
.light {
@include theme.components-theme(
Expand All @@ -33,6 +30,7 @@ $dark-colors: map-merge($dark-colors, map-get(tokens.$tokens, dark));

.sb-show-main {
background-color: var(--mdc-theme-surface);
color: var(--cv-theme-on-surface);

.sbdocs-wrapper {
padding-top: 0;
Expand Down Expand Up @@ -718,7 +716,6 @@ pre.prismjs {
}

/* -- Dark theme -- */

.dark pre.prismjs {
/**
* Coldark Theme for Prism.js
Expand Down
2 changes: 1 addition & 1 deletion libs/components/.storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<link
href="https://cdn.jsdelivr.net/npm/@covalent/tokens@8.1.0-beta.6/index.css"
href="https://cdn.jsdelivr.net/npm/@covalent/tokens@latest/index.css"
rel="stylesheet"
/>
<style>
Expand Down
3 changes: 0 additions & 3 deletions libs/components/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
"mkdir -p dist/libs/components/theme/prebuilt",
"cp libs/components/src/index.scss dist/libs/components",
"cp libs/components/src/theme/_index.scss dist/libs/components/theme",
"cp libs/components/src/icon/*theme.scss dist/libs/components/icon",
"mkdir -p dist/libs/components/data-table",
"cp libs/components/src/data-table/*theme.scss dist/libs/components/data-table",
"./node_modules/.bin/sass --trace --color --style=compressed --load-path=node_modules ./libs/components/src/theme/prebuilt:./dist/libs/components/theme/prebuilt"
],
"parallel": false
Expand Down
10 changes: 0 additions & 10 deletions libs/components/src/icon/_icon.theme.scss

This file was deleted.

2 changes: 0 additions & 2 deletions libs/components/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
@forward './theme' show components-theme;
@forward './icon/icon.theme' show core-styles;
@forward './data-table/data-table.theme' show data-table-theme;
9 changes: 9 additions & 0 deletions libs/icons/covalent-icons.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
font-display: block;
}

/* Support mdc icon font variable */
.covalent-icon,
.covalent-icons,
[covalent-icon],
[covalent-icons],
[iconFont='covalent-icons'] {
--mdc-icon-font: 'covalent-icons';
}

[class^='cov-'],
[class*=' cov-'] {
/* use !important to prevent issues with browser extensions that change fonts */
Expand Down
9 changes: 9 additions & 0 deletions libs/icons/covalent-icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
font-display: block;
}

/* Support mdc icon font variable */
.covalent-icon,
.covalent-icons,
[covalent-icon],
[covalent-icons],
[iconFont='covalent-icons'] {
--mdc-icon-font: '#{$icomoon-font-family}';
}

[class^='cov-'],
[class*=' cov-'] {
/* use !important to prevent issues with browser extensions that change fonts */
Expand Down

0 comments on commit 37c7c5d

Please sign in to comment.