Skip to content

Commit

Permalink
chore: add comment to generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
elevatebart committed Feb 10, 2025
1 parent b2543dc commit 68b52ce
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
11 changes: 9 additions & 2 deletions scripts/generate-palette.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import figma from "../storybook/Figma.json" with {type: "json"}

const __dirname = path.dirname(new URL(import.meta.url).pathname)

const autoGeneratedComment = `/**
* This file is auto-generated by scripts/generate-palette.mjs.
* It is a summary of color choices made in Figma.
* Should you need to make a change in it, ask a designer
* at Kestra first, so your changes are not overwritten.
*/`

const [{
color:paletteLight
}, {
Expand Down Expand Up @@ -97,12 +104,12 @@ function makePalettes(palette, paletteName, selector) {
const scss = baseColorNames.map(color => `$base-${color.name.split("/").pop()}: ${color.value};`).join("\n")

// write the scss file containing colors in the base palette
fs.writeFileSync(path.resolve(__dirname, "../src/scss/_color-palette.scss"), scss, {encoding: "utf-8"})
fs.writeFileSync(path.resolve(__dirname, "../src/scss/_color-palette.scss"), `${autoGeneratedComment}\n${scss}`, {encoding: "utf-8"})

const {tokenScss, cssVariableNames} = getVariableScss(palette.filter(c => !c.name.startsWith("base-color-palette/")), colorIndex)

// write the scss file containing colors in the token palette
fs.writeFileSync(path.resolve(__dirname, `../src/scss/ks-theme-${paletteName}.scss`), `@import "./color-palette.scss";\n\n${selector}{\n\t${tokenScss}\n}`, {encoding: "utf-8"})
fs.writeFileSync(path.resolve(__dirname, `../src/scss/ks-theme-${paletteName}.scss`), `${autoGeneratedComment}\n@import "./color-palette.scss";\n\n${selector}{\n\t${tokenScss}\n}`, {encoding: "utf-8"})

// write the css variables into an index for theme documentation
// NOTE: we assume that all themes will have the same variables and write the same file over and over
Expand Down
4 changes: 2 additions & 2 deletions src/components/topology/Topology.vue
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@
</script>

<style scoped lang="scss">
:deep(.unused-path) {
<style lang="scss">
.unused-path {
opacity: 0.3;
}
</style>
Expand Down
6 changes: 6 additions & 0 deletions src/scss/_color-palette.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* This file is auto-generated by scripts/generate-palette.mjs.
* It is a summary of color choices made in Figma.
* Should you need to make a change in it, ask a designer
* at Kestra first, so your changes are not overwritten.
*/
$base-black: #14181f;
$base-blue-50: #c7f0ff;
$base-blue-100: #a2cdff;
Expand Down
6 changes: 6 additions & 0 deletions src/scss/ks-theme-dark.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* This file is auto-generated by scripts/generate-palette.mjs.
* It is a summary of color choices made in Figma.
* Should you need to make a change in it, ask a designer
* at Kestra first, so your changes are not overwritten.
*/
@import "./color-palette.scss";

html.dark{
Expand Down
6 changes: 6 additions & 0 deletions src/scss/ks-theme-light.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* This file is auto-generated by scripts/generate-palette.mjs.
* It is a summary of color choices made in Figma.
* Should you need to make a change in it, ask a designer
* at Kestra first, so your changes are not overwritten.
*/
@import "./color-palette.scss";

:root{
Expand Down

1 comment on commit 68b52ce

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.