Skip to content

Commit

Permalink
feat(tools/css-dev-tools): remove postcss-base64 & base64 transformat…
Browse files Browse the repository at this point in the history
…ion (#1258)
  • Loading branch information
mohamedMok authored and tiloyi committed Jun 14, 2023
1 parent 4af744d commit d7aff62
Show file tree
Hide file tree
Showing 12 changed files with 103 additions and 107 deletions.
9 changes: 0 additions & 9 deletions packages/css-dev-tools/postcssPluginConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const scssSyntax = require('postcss-scss')
const autoprefixer = require('autoprefixer')
const postcssSass = require('@csstools/postcss-sass')
const stylelint = require('stylelint')
const base64 = require('postcss-base64')
const reporter = require('postcss-reporter')
const cssnano = require('cssnano')
const purgecss = require('@fullhuman/postcss-purgecss')
Expand Down Expand Up @@ -35,10 +34,6 @@ const plugins = [
reporter({ clearReportedMessages: true }),
cssprepend(`$mozaic-env: ${mozaicEnvScssVar};`),
postcssSass(sassConfig),
base64({
pattern: /<svg.*<\/svg>/i,
prepend: 'data:image/svg+xml;base64,',
}),
mqpackerondemand({
sort: true,
}),
Expand All @@ -58,10 +53,6 @@ if (CM.getKey('autoprefixer.disabled')) {
const productionPlugins = [
cssprepend(`$mozaic-env: ${mozaicEnvScssVar};`),
postcssSass(sassConfig),
base64({
pattern: /<svg.*<\/svg>/i,
prepend: 'data:image/svg+xml;base64,',
}),
mqpackerondemand({
sort: true,
}),
Expand Down
26 changes: 5 additions & 21 deletions packages/styles/components/_c.checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@
}

&:checked {
background-image: url(
inline-icons(
"checkmark-16",
$color-input-checked-icon
));
background-image: url("#{inline-icons('checkmark-16', $color-input-checked-icon)}");
background-position: center center;

&::-ms-check {
Expand All @@ -86,11 +82,7 @@
}

&:indeterminate {
background-image: url(
inline-icons(
"control-less-16",
$color-input-checked-icon
));
background-image: url("#{inline-icons('control-less-16', $color-input-checked-icon)}");
}

&:disabled {
Expand All @@ -104,19 +96,11 @@
}

&:checked {
background-image: url(
inline-icons(
"checkmark-16",
$color-input-disabled-icon
));
background-image: url("#{inline-icons('checkmark-16', $color-input-disabled-icon)}");
}

&:indeterminate {
background-image: url(
inline-icons(
"control-less-16",
$color-input-disabled-icon
));
background-image: url("#{inline-icons('control-less-16', $color-input-disabled-icon)}");
}

& + #{$parent}__label {
Expand All @@ -132,7 +116,7 @@
}

&:hover {
@include add-demo-state-class {
@include add-demo-state-class() {
border-color: $color-input-invalid-hover-border;

&::-ms-check {
Expand Down
5 changes: 3 additions & 2 deletions packages/styles/components/_c.modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@
@include set-focus-floating-base();

align-self: flex-start;
background: transparent
url(inline-icons("control-cross-32", $color-dialog-close)) no-repeat;
background-color: transparent;
background-image: url("#{inline-icons('control-cross-32', $color-dialog-close)}");
background-repeat: no-repeat;
background-size: contain;
cursor: pointer;
height: $mu200;
Expand Down
2 changes: 1 addition & 1 deletion packages/styles/components/_c.radio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
}

&:hover {
@include add-demo-state-class {
@include add-demo-state-class() {
border-color: $color-input-invalid-hover-border;

&::-ms-check {
Expand Down
24 changes: 4 additions & 20 deletions packages/styles/components/_c.stars-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,36 +107,20 @@
&:checked,
&:focus {
& ~ #{$parent}__label {
background-image: url(
inline-icons(
"#{$icon-empty}",
$color-star-full
));
background-image: url("#{inline-icons($icon-empty, $color-star-full)}");
}
& + #{$parent}__label {
background-image: url(
inline-icons(
"#{$icon-full}",
$color-star-full
));
background-image: url("#{inline-icons($icon-full, $color-star-full)}");
}
}

&:hover {
& ~ #{$parent}__label {
background-image: url(
inline-icons(
"#{$icon-empty}",
$color-star-full
));
background-image: url("#{inline-icons($icon-empty, $color-star-full)}");
}

& + #{$parent}__label {
background-image: url(
inline-icons(
"#{$icon-full}",
$color-star-full
));
background-image: url("#{inline-icons($icon-full, $color-star-full)}");
}
}
}
Expand Down
121 changes: 77 additions & 44 deletions packages/styles/settings-tools/_s.inline-icons.scss

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/tokens/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

### Bug Fixes


* **pattern/colors:** update the color of the notification icons ([#1104](https://github.com/adeo/mozaic-design-system/issues/1104)) ([4bfba3f](https://github.com/adeo/mozaic-design-system/commit/4bfba3fce58f84ea8179d4223252662b28e3812d))


Expand Down
3 changes: 1 addition & 2 deletions src/docs/Components/Flags/previews/default.preview.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
@import "tokens";
@import "settings-tools/all-settings";
@include import-font-families();
@import "components/c.flag";

html {
@include set-font-face();
}

@import "components/c.flag";

.example {
margin: $mu100 auto;
padding: 0 $mu150;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
@import "tokens";
@import "settings-tools/all-settings";
@include import-font-families();

html {
@include set-font-face();
}

@import "components/c.checkbox";
@import "components/c.button";
@import "typography/t.bodys";
@import "components/c.option-card";

html {
@include set-font-face();
}

.example {
@include set-font-family();

Expand Down
5 changes: 3 additions & 2 deletions src/docs/Components/Tabs/previews/tabs-dropdown.preview.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
@import "tokens";
@import "settings-tools/all-settings";
@include import-font-families();
@import "components/c.tabs";
@import "components/c.select";

html {
@include set-font-face();
}
@import "components/c.tabs";
@import "components/c.select";

body {
background-color: #e5e5e5;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
@import "tokens";
@import "settings-tools/all-settings";
@include import-font-families();
html {
@include set-font-face();
}
@import "components/c.tabs";

body {
Expand Down
1 change: 0 additions & 1 deletion src/docs/GetStarted/Developers/Installation/postcss.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ The Mozaic postCSS plugin list contains:
- **nodeSass:** compile SCSS into css
- **autoprefixer:** automatically add browser prefixes
- **mqpacker on demand:** a custom built media queries regrouper based on comments
- **postcss-base64:** url encode svg in css
- **cssnano:** optimize and minify the CSS code

### A) Using a configuration file:
Expand Down

0 comments on commit d7aff62

Please sign in to comment.