New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

radium

Package Overview
Dependencies
Maintainers
2
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

radium - npm Package Compare versions

Comparing version 0.0.1 to 0.9.0

.npmignore

32

package.json
{
"name": "radium",
"version": "0.0.1"
"version": "0.9.0",
"description": "",
"main": "modules/index.js",
"repository": {
"type": "git",
"url": "https://github.com/formidablelabs/radium.git"
},
"homepage": "https://github.com/formidablelabs/radium",
"bugs": "https://github.com/formidablelabs/radium/issues",
"directories": {
"example": "examples"
},
"authors": [
"Alex Lande"
],
"scripts": {
"examples": "webpack-dev-server --config examples/webpack.config.js --no-info --content-base examples/"
},
"license": "MIT",
"peerDependencies": {
"react": "0.12.x"
},
"dependencies": {
"lodash": "^3.2.0"
},
"devDependencies": {
"jsx-loader": "^0.12.2",
"react": "0.12.x",
"webpack": "^1.5.3",
"webpack-dev-server": "^1.7.0"
}
}

87

README.md
# Radium
An element styling UI framework for React.
Radium is a **toolchain** for handling modifiers, states, computed styles and
responsive styles when working with **inline styles in react components**
(at Formidable, we call this _component styling_ because styles are specific to,
and scoped to, the component rather than in external style sheets).
Radium allows you to handle complex component styling in a declarative,
easy to write way. Component styling in React provides a number of
benefits over traditional CSS:
Radium is a highly configurable toolkit for building large-scale web
applications with React and element styling. Element styling in React provides a
number of benefits over traditional CSS:
- Scoped styles, meaning no more global variables

@@ -15,23 +17,62 @@ - Avoids specificity conflicts

Radium uses these benefits to create UI components to get you running quickly.
It can be used out of the box for prototypes and experiments, or themed and
customized to fit any design language.
It provides reusable components and tools for your own element styling.
Inspired by <a href="https://speakerdeck.com/vjeux/react-css-in-js">React: CSS
in JS</a> by <a href="https://twitter.com/Vjeux">Christopher Chedeau</a>.
## What's Included
## Docs
- Shared Styles
- Color
- Typography
- UI Components
- Button
- Form controls
- Responsive grid system
- More coming soon!
- Styling Utilities
- Pseudo-selector support
- Media query support
- [Guides](docs/guides)
- [Overview](docs/guides/overview.md)
- [Media Queries](docs/guides/media-queries.md)
- [Computed Styles](docs/guides/computed-styles.md)
- [API Docs](docs/api)
## What does it look like?
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.
```js
render: function () {
var styles = {
padding: '1.5em',
borderRadius: 4,
font-size: window.devicePixelRatio === 2 ? "16px" : "14px",
height: function () {
return window.innerWidth / 2 + "px";
},
states: [
{ hover: { color: '#fff' }},
{ focus: { boxShadow: '0 0 0 5px'}}
],
mediaQueries: [
{ small: { margin: 10 }},
{ large: { margin: 30 }}
],
modifiers: [
{
type: {
primary: { background: '#0074D9' },
warning: { background: '#FF4136' }
}
}
]
};
return (
<div style={this.buildStyles(styles)} />
);
}
```
For more in-depth usage, see the [overview guide](docs/guides/overview.md).
## Examples
To see local examples in action, do this:
```
npm install
npm run examples
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc