mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 18:27:41 +01:00
fix: readded gap between x-ray preview comment icons. (#1915)
* fix: readded gap between x-ray preview comment icons. * feat: keep size 400px --------- Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
This commit is contained in:
@@ -14,19 +14,17 @@ const changedFiles = changedFilesPathString
|
||||
.filter((file, idx, arr) => arr.indexOf(file) === idx);
|
||||
|
||||
const getImageTagsByFiles = (files, getBaseUrl, width) =>
|
||||
files
|
||||
.map((file) => {
|
||||
const svgContent = fs.readFileSync(path.join(process.cwd(), file), 'utf-8');
|
||||
const strippedAttrsSVG = svgContent.replace(/<svg[^>]*>/, '<svg>');
|
||||
const minifiedSvg = minifySvg(strippedAttrsSVG);
|
||||
files.map((file) => {
|
||||
const svgContent = fs.readFileSync(path.join(process.cwd(), file), 'utf-8');
|
||||
const strippedAttrsSVG = svgContent.replace(/<svg[^>]*>/, '<svg>');
|
||||
const minifiedSvg = minifySvg(strippedAttrsSVG);
|
||||
|
||||
const base64 = Buffer.from(minifiedSvg).toString('base64');
|
||||
const url = getBaseUrl(file);
|
||||
const widthAttr = width ? `width="${width}"` : '';
|
||||
const base64 = Buffer.from(minifiedSvg).toString('base64');
|
||||
const url = getBaseUrl(file);
|
||||
const widthAttr = width ? `width="${width}"` : '';
|
||||
|
||||
return `<img title="${file}" alt="${file}" ${widthAttr} src="${url}/${base64}.svg"/>`;
|
||||
})
|
||||
.join('');
|
||||
return `<img title="${file}" alt="${file}" ${widthAttr} src="${url}/${base64}.svg"/>`;
|
||||
});
|
||||
|
||||
const svgFiles = readSvgDirectory(ICONS_DIR).map((file) => `icons/${file}`);
|
||||
|
||||
@@ -35,29 +33,32 @@ const iconsFilteredByName = (search) => svgFiles.filter((file) => file.includes(
|
||||
const cohesionRandomImageTags = getImageTagsByFiles(
|
||||
shuffle(svgFiles).slice(0, changedFiles.length),
|
||||
() => `${BASE_URL}/stroke-width/2`,
|
||||
);
|
||||
).join('');
|
||||
|
||||
const cohesionSquaresImageTags = getImageTagsByFiles(
|
||||
shuffle(iconsFilteredByName('square')).slice(0, changedFiles.length),
|
||||
() => `${BASE_URL}/stroke-width/2`,
|
||||
);
|
||||
).join('');
|
||||
|
||||
const changeFiles1pxStrokeImageTags = getImageTagsByFiles(
|
||||
changedFiles,
|
||||
() => `${BASE_URL}/stroke-width/1`,
|
||||
);
|
||||
).join('');
|
||||
|
||||
const changeFiles2pxStrokeImageTags = getImageTagsByFiles(
|
||||
changedFiles,
|
||||
() => `${BASE_URL}/stroke-width/2`,
|
||||
);
|
||||
).join('');
|
||||
|
||||
const changeFiles3pxStrokeImageTags = getImageTagsByFiles(
|
||||
changedFiles,
|
||||
() => `${BASE_URL}/stroke-width/3`,
|
||||
);
|
||||
).join('');
|
||||
|
||||
const changeFilesLowDPIImageTags = getImageTagsByFiles(changedFiles, () => `${BASE_URL}/dpi/24`);
|
||||
const changeFilesLowDPIImageTags = getImageTagsByFiles(
|
||||
changedFiles,
|
||||
() => `${BASE_URL}/dpi/24`,
|
||||
).join(' ');
|
||||
|
||||
const changeFilesXRayImageTags = getImageTagsByFiles(
|
||||
changedFiles,
|
||||
@@ -67,7 +68,7 @@ const changeFilesXRayImageTags = getImageTagsByFiles(
|
||||
return `${BASE_URL}/${iconName}`;
|
||||
},
|
||||
400,
|
||||
);
|
||||
).join(' ');
|
||||
|
||||
const commentMarkup = `\
|
||||
### Added or changed icons
|
||||
|
||||
Reference in New Issue
Block a user