Skip to content

Commit

Permalink
fix: adapt purgecss configuration to prevent purging needed styles (#601
Browse files Browse the repository at this point in the history
)

* fix: toast styling after purgecss
* fix: recaptcha badge hiding after purgecss
* fix: nav tabs styling after purgecss
Co-authored-by: Susanne Schneider <s.schneider@intershop.de>
  • Loading branch information
dhhyi authored Mar 19, 2021
1 parent dca5385 commit 87a3135
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/styles/global/forms/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ input.form-check-input {
}
}

/* purgecss ignore */
.grecaptcha-badge {
visibility: hidden;
}
Expand Down
1 change: 0 additions & 1 deletion src/styles/global/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ img {
.nav-tabs {
display: block;
margin-bottom: $space-default;
overflow-x: auto;
white-space: nowrap;

.nav-item {
Expand Down
3 changes: 3 additions & 0 deletions src/styles/global/toasts.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* purgecss start ignore */
.toast-container {
z-index: 1030; // appears on top of the page but below the modal windows

Expand Down Expand Up @@ -71,3 +72,5 @@
background-color: theme-color-level('success', $alert-border-level);
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="#{$toastViewBox}" fill="#{$toast-success-color}">#{$toast-success-icon}</svg>');
}

/* purgecss end ignore */
11 changes: 10 additions & 1 deletion templates/webpack/webpack.custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,16 @@ export default (
paths: glob.sync('./{src,projects}/**/*', { nodir: true }),
safelist: {
standard: [/(p|m)(l|r|x|y|t|b)?-[0-5]/],
greedy: [/\bfa\b/, /\bmodal\b/, /\bswiper\b/, /\bcarousel\b/, /\bslide\b/],
greedy: [
/\bfa\b/,
/\bmodal\b/,
/\bswiper\b/,
/\bcarousel\b/,
/\bslide\b/,
/\btoast-close-button\b/,
/\bnav-tabs\b/,
/\bnav-link\b/,
],
},
})
);
Expand Down

0 comments on commit 87a3135

Please sign in to comment.