
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
npm install radium
Radium is a set of tools to manage inline styles on React elements. It gives you powerful styling capabilities without CSS.
Inspired by React: CSS in JS by Christopher Chedeau.
Eliminating CSS in favor of inline styles that are computed on the fly is a powerful approach, providing a number of benefits over traditional CSS:
Despite that, there are some common CSS features and techniques that inline styles don't easily accommodate: media queries, browser states (:hover, :focus, :active) and modifiers (no more .btn-primary!). Radium offers a standard interface and abstractions for dealing with these problems.
When we say expressive, we mean it: math, concatenation, regex, conditionals, functions–JavaScript is at your disposal. Modern web applications demand that the display changes when data changes, and Radium is here to help.
:hover
, :focus
, and :active
Start by writing a style object with a combination of default styles, browser states, media queries, and modifiers. Pass the object to this.buildStyles()
and Radium will determine the correct group of style rules to apply to your component.
<Button kind='primary'>Radium Button</Button>
var React = require('react');
var { StyleResolverMixin, BrowserStateMixin } = require('radium');
var color = require('color');
var Button = React.createClass({
mixins: [ StyleResolverMixin, BrowserStateMixin ],
render: function () {
var styles = {
padding: '1.5em 2em',
border: 0,
borderRadius: 4,
color: '#fff',
cursor: 'pointer',
fontSize: 16,
fontWeight: 700,
states: [
{ hover: {
background: color('#0074d9').lighten(0.2).hexString()
}},
{ focus: {
boxShadow: '0 0 0 3px #eee, 0 0 0 6px #0074D9',
outline: 'none'
}}
],
modifiers: [
{ kind: {
primary: { background: '#0074D9' },
warning: { background: '#FF4136' }
}}
]
};
return (
<button
{...this.getBrowserStateEvents()}
style={this.buildStyles(styles)}
>
{this.props.children}
</button>
);
}
});
To see local examples in action, do this:
npm install
npm run examples
Please see CONTRIBUTING
FAQs
A set of tools to manage inline styles on React elements
The npm package radium receives a total of 37,866 weekly downloads. As such, radium popularity was classified as popular.
We found that radium demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 30 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.