Skip to content

Commit

Permalink
Merge pull request #4382 from julien/fix-flag-icon-names
Browse files Browse the repository at this point in the history
fix(@clayui/css): use correct icon names for flags in spritesheet
  • Loading branch information
matuzalemsteles committed Oct 28, 2021
2 parents 3d19d12 + 05b7094 commit 83ce58c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
*.d.ts
bower_components
build
clay-css
copyright.js
coverage
lib
Expand All @@ -11,5 +9,6 @@ clayui.com/react-docgen
clayui.com/static
node_modules
package-lock.json
/packages/clay-css/src/js/**/*.js
packages/generator-clay-component/app/templates
yarn.lock
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ node_modules
package-lock.json
/packages/clay-css/**/*.md
/packages/clay-css/src/js/**/*.js
/packages/clay-css/sassdoc-theme-clay-css
/packages/clay-css/src/scss/bootstrap/**/*.scss
/packages/generator-clay-component/app/templates
yarn.lock
7 changes: 6 additions & 1 deletion packages/clay-css/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
* SPDX-License-Identifier: BSD-3-Clause
*/

var path = require('path');

var srcDir = path.join(__dirname, 'src');
Expand All @@ -6,5 +11,5 @@ module.exports = {
buildDir: path.join(__dirname, 'lib'),
includePaths: [path.join(srcDir, 'scss')],
libDir: path.join(__dirname, 'lib'),
srcDir: srcDir,
srcDir,
};
11 changes: 6 additions & 5 deletions packages/clay-css/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

const fs = require('fs');
const {JSDOM} = require('jsdom');
const {optimize} = require('svgo');
const path = require('path');
const sass = require('sass');
const {optimize} = require('svgo');

const OUTPUT_DIRECTORY = path.resolve('./lib');

Expand Down Expand Up @@ -89,7 +89,10 @@ async function buildIconsSvg(filesPath) {

await Promise.all(
filesPath.map(async (file) => {
const fileName = path.basename(file, '.svg');
const fileName = path
.basename(file, '.svg')
.toLowerCase()
.replace(REGEX_FLAGS, '');

const data = await fs.promises.readFile(
`${ICONS_DIRECTORY}${path.sep}${file}`,
Expand Down Expand Up @@ -141,13 +144,11 @@ async function buildScssIcons(filesPath) {
const endTag = sourceIconsScss.indexOf(');');

// Writes the source file header to the stream.
fileWritable.write(sourceIconsScss.slice(0, startTag) + '$lx-icons: (\n\n');
fileWritable.write(`${sourceIconsScss.slice(0, startTag)}$lx-icons: (\n\n`);

filesPath.sort();

for (const file of filesPath) {
const fileName = path.basename(file, '.svg');

const data = await fs.promises.readFile(
`${ICONS_DIRECTORY}${path.sep}${file}`,
'utf8'
Expand Down

0 comments on commit 83ce58c

Please sign in to comment.