
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
@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 20 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
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.