Skip to content

Commit

Permalink
Merge pull request #1225 from international-labour-organization/build…
Browse files Browse the repository at this point in the history
…/styles/cssnano-swap

gulp-cssnano replacement
  • Loading branch information
justintemps authored Sep 25, 2024
2 parents a00394e + a5c99dd commit 12ea47b
Show file tree
Hide file tree
Showing 10 changed files with 1,061 additions and 2,363 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-spies-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ilo-org/styles": patch
---

Replace deprecated gulp-cssnano with cssnano via postcss for minifying production stylesheets
5 changes: 5 additions & 0 deletions .changeset/silly-pans-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ilo-org/styles": patch
---

fixed tooltip placement divison
5 changes: 3 additions & 2 deletions packages/icon-build-helpers/src/builders/vanilla.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ async function builder(metadata, { output }) {
for (const m of modules) {
files[m.filepath] = m.source;
input[m.filepath] = m.filepath;
files["index.js"] +=
`\nexport { default as ${m.moduleName} } from '${m.filepath}';`;
files[
"index.js"
] += `\nexport { default as ${m.moduleName} } from '${m.filepath}';`;
}

const bundle = await rollup({
Expand Down
5 changes: 3 additions & 2 deletions packages/icon-build-helpers/src/builders/vue/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ async function builder(metadata, { output }) {
for (const m of modules) {
files[m.filepath] = m.source;
input[m.filepath] = m.filepath;
files["index.js"] +=
`\nexport { default as ${m.moduleName} } from '${m.filepath}';`;
files[
"index.js"
] += `\nexport { default as ${m.moduleName} } from '${m.filepath}';`;
}

const bundle = await rollup({
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const Accordion: FC<AccordionProps> = ({
const expandedOnLoad = allowMultipleExpanded
? defaultAccordionsExpanded
: defaultAccordionsExpanded.length > 0
? [defaultAccordionsExpanded[0]]
: defaultAccordionsExpanded;
? [defaultAccordionsExpanded[0]]
: defaultAccordionsExpanded;
setActiveItems(expandedOnLoad);
}, [defaultAccordionsExpandedString, allowMultipleExpanded]);

Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/Tag/TagSet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const TagSet: FC<TagSetProps> = ({
const tagOnLoad = allowMultipleActive
? defaultTagActive
: defaultTagActive.length > 0
? [defaultTagActive[0]]
: defaultTagActive;
? [defaultTagActive[0]]
: defaultTagActive;
setActiveItems(tagOnLoad);
}, [defaultTagActiveString, allowMultipleActive]);

Expand Down
20 changes: 15 additions & 5 deletions packages/styles/gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import dartSass from "sass";
import rename from "gulp-rename";
import cleanCSS from "gulp-clean-css";
import { deleteAsync } from "del";
import cssnano from "gulp-cssnano";
import cssnano from "cssnano";
import postcss from "gulp-postcss";
import sourcemaps from "gulp-sourcemaps";

Expand Down Expand Up @@ -51,8 +51,13 @@ gulp.task("compile components into css", function () {
gulp.task("minify css components", function () {
return gulp
.src(`${COMPILED_COMPONENTS}/*.css`)
.pipe(postcss())
.pipe(cssnano({ zindex: false }))
.pipe(
postcss([
cssnano({
zindex: false,
}),
])
)
.pipe(gulp.dest(COMPILED_COMPONENTS));
});

Expand Down Expand Up @@ -80,8 +85,13 @@ gulp.task("bundle main css", function () {
gulp.task("minify main css bundle", function () {
return gulp
.src(`${SRC}/*.css`)
.pipe(postcss())
.pipe(cssnano({ zindex: false }))
.pipe(
postcss([
cssnano({
zindex: false,
}),
])
)
.pipe(gulp.dest(BUILD));
});

Expand Down
2 changes: 1 addition & 1 deletion packages/styles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
"@ilo-org/themes": "workspace:*"
},
"devDependencies": {
"cssnano": "^7.0.6",
"del": "^7.0.0",
"gulp": "^4.0.2",
"gulp-clean-css": "^4.3.0",
"gulp-cssnano": "^2.1.3",
"gulp-postcss": "^9.0.1",
"gulp-rename": "^2.0.0",
"gulp-sass": "^5.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/styles/scss/components/_formcontrol.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,6 @@
}

.ilo--tooltip--wrapper {
bottom: calc(#{spacing(1)}, 2);
bottom: calc(#{spacing(1)} / 2);
}
}
Loading

0 comments on commit 12ea47b

Please sign in to comment.