
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@mapbox/frontend-util-styles
Advanced tools
frontend-util-styles includes two things:
npm install @mapbox/frontend-util-styles
styles.js maintains state of a style object and exports three functions:
Get the corresponding style rules for a given constant.
getStyle('h1');
// 'txt-h1-mm txt-h2 txt-fancy'
Pass an array of strings as an optional second argument in order to exclude classes from the style constant:
getStyle('h1', ['txt-fancy']);
// 'txt-h1-mm txt-h2'
Use this method to combine a set of constants with existing constants.
mergeStyles({
h1: 'some nice classes',
foo: 'bar'
});
/*
_styles ->
{
h1: 'some nice classes',
h2: 'txt-h2-mm txt-h3 txt-fancy mb6',
...
foo: 'bar'
}
*/
Set the contents of the styles object. Overrides existing constants. Use this method if you do not want to use the default values in src/styles.js:
setStyles({ foo: 'bar' });
/*
_styles ->
{
foo: 'bar'
}
*/
Use the styles util to set the className property in React components:
import { mergeStyles, getStyle } from '../src/styles';
mergeStyles({
specialHeading: 'some fun classes',
specialParagraph: 'more fun classes'
});
class Example extends React.Component {
render() {
return (
<div>
<div className={getStyle('specialHeading')}>
Hello world!
</div>
<div className={getStyle('h1', ['txt-fancy'])}>
Goodbye world!
</div>
</div>);
}
}
/*
<div>
<div class='some fun classes'>
Hello world!
</div>
<div class='txt-h1-mm txt-h2 mb6'>
Goodbye world!
</div>
</div>
*/
FAQs
A Mapbox frontend utility
The npm package @mapbox/frontend-util-styles receives a total of 7 weekly downloads. As such, @mapbox/frontend-util-styles popularity was classified as not popular.
We found that @mapbox/frontend-util-styles demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 187 open source maintainers 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.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.