
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
postcss-fontstack
Advanced tools
Easy insertion of font stacks into font-family declarations
body {
font-family: 'Open Sans', fontstack('Arial');
}
h2 {
font-family: fontstack('');
}
/* results */
body {
font-family: 'Open Sans', Arial, "Helvetica Neue", Helvetica, sans-serif;
}
h2 {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
Add PostCSS Fontstack in your project.
npm i postcss-fontstack -D
Use PostCSS Fontstack to process your CSS:
import FontStack from 'postcss-fontstack'
FontStack.process(YOUR_CSS /*, processOptions, pluginOptions */);
Or use it as a PostCSS Plugin:
import postcss from 'postcss';
import FontStack from 'postcss-fontstack';
postcss([
FontStack(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
PostCSS Stack runs with Webpack
Add PostCSS Loader to your project:
npm i postcss-loader -D
Use PostCSS Fontstack in your Webpack configuration:
const FontStack = require('postcss-fontstack');
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
{ loader: 'css-loader', options: { importLoaders: 1 } },
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: [
FontStack(/* pluginOptions */)
]
}
}
]
}
]
}
}
You can custom the fontstacks by the fontstacks
option.
FontStack({
fontstacks: {
'Tomo': '"Tomo Regular", Arial, sans-serif',
}
})
body {
font-family: fontstack('Tomo');
}
/* results */
body {
font-family: 'Tomo Regular', Arial, sans-serif;
}
the default fontstacks
default: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',
// Sans-serif
'Arial': 'Arial, "Helvetica Neue", Helvetica, sans-serif',
'Arial Black': '"Arial Black", "Arial Bold", Gadget, sans-serif',
'Arial Narrow': '"Arial Narrow", Arial, sans-serif',
'Gill Sans': '"Gill Sans", "Gill Sans MT", Calibri, sans-serif',
'Tahoma': 'Tahoma, Verdana, Segoe, sans-serif',
'Verdana': 'Verdana, Geneva, sans-serif',
// Serif
'Georgia': 'Georgia, Times, "Times New Roman", serif',
'Palatino': 'Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif',
'Times New Roman': 'TimesNewRoman, "Times New Roman", Times, Baskerville, Georgia, serif',
// Monospaced
'Courier New': '"Courier New", Courier, "Lucida Sans Typewriter", "Lucida Typewriter", monospace',
'Lucida Sans Typewriter': '"Lucida Sans Typewriter", "Lucida Console", monaco, "Bitstream Vera Sans Mono", monospace',
// Fantasy
'Copperplate': 'Copperplate, "Copperplate Gothic Light", fantasy',
'Papyrus': 'Papyrus, fantasy',
// Script
'Brush Script MT': '"Brush Script MT", cursive'
FAQs
easy insertion of font stacks into font-family declarations
The npm package postcss-fontstack receives a total of 1 weekly downloads. As such, postcss-fontstack popularity was classified as not popular.
We found that postcss-fontstack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.