mirror of
https://github.com/iconoir-icons/iconoir
synced 2024-05-19 06:47:02 +02:00
Merge pull request #141 from sammarks/css-icon-style-fix
fix: css styles should now support color and font-size
This commit is contained in:
commit
867721ad79
19
bin/build.js
19
bin/build.js
|
@ -1,6 +1,6 @@
|
|||
import path from 'path';
|
||||
import os from 'os';
|
||||
import { promises as fs } from 'fs';
|
||||
import { promises as fs, readFileSync } from 'fs';
|
||||
import execa from 'execa';
|
||||
import { Listr } from 'listr2';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
@ -84,16 +84,23 @@ const tasks = new Listr(
|
|||
cliTargets.length === 0 || cliTargets.includes('css'),
|
||||
task: async (ctx) => {
|
||||
const content = [
|
||||
await fs.readFile(path.join(__dirname, 'header.css'), 'utf8'),
|
||||
(
|
||||
await fs.readFile(
|
||||
path.join(__dirname, 'header.css'),
|
||||
'utf8'
|
||||
)
|
||||
).replace('[YEAR]', new Date().getFullYear()),
|
||||
];
|
||||
content.push(
|
||||
'i[class*=" iconoir-"]::before,i[class^=iconoir-]::before{line-height:1;position:relative;top:4px}'
|
||||
);
|
||||
ctx.iconoirIconsFiles.forEach((file) => {
|
||||
const fileContents = readFileSync(
|
||||
path.join(__dirname, '../icons/', file)
|
||||
)
|
||||
.toString()
|
||||
.replace(/\n/g, '');
|
||||
content.push(
|
||||
`.iconoir-${
|
||||
path.parse(file).name
|
||||
}::before{content:url(../icons/${file})}`
|
||||
}::before{mask-image:url('data:image/svg+xml;charset=utf-8,${fileContents}');-webkit-mask-image:url('data:image/svg+xml;charset=utf-8,${fileContents}');}`
|
||||
);
|
||||
});
|
||||
await fs.writeFile(
|
||||
|
|
|
@ -1,6 +1,21 @@
|
|||
/*!
|
||||
* Iconoir
|
||||
* Copyright (c) 2021 Luca Burgio - https://iconoir.com
|
||||
* Copyright (c) [YEAR] Luca Burgio - https://iconoir.com
|
||||
* License - https://github.com/lucaburgio/iconoir/blob/master/LICENSE (Code: MIT License)
|
||||
* CSS file created by Till Esser (@Wiwaltill) and automated by Pascal Jufer (@paescuj)
|
||||
*/
|
||||
|
||||
*[class^="iconoir-"]::before,
|
||||
*[class*=" iconoir-"]::before {
|
||||
content: " ";
|
||||
display: block;
|
||||
background: currentColor;
|
||||
mask-size: cover;
|
||||
-webkit-mask-size: cover;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
}
|
||||
*[class^="iconoir-"],
|
||||
*[class*=" iconoir-"] {
|
||||
display: block;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue