Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
classed-components
Advanced tools
Like styled-components but for classes. Quickly create components based on CSS classes.
Like styled-components but for classes.
When using CSS Frameworks such as MaterializeCSS it is nice to create components out of existing classes from that framework.
classed-components helps you do that in a convenient way.
npm i --save classed-components
import classed from 'classed-components'
const Header = classed.div`
header
green
`
const App = props => {
return <Header />
}
import classed from 'classed-components'
const Header = classed.div`
header
green
`
const HeaderBlack = classed(Header)`black col s12`
You can use include or exclude certain classes based on props or other variables in the current scope. This is a feature you might know from the classnames module. Whenever an embedding/interpolition within the template string returns a boolean it is interpreted as a condition on the preceeding classname.
import classed from 'classed-components'
const large = true
const MyComponent = classed.div`
header ${props => props.needsHeader}
green
large ${large}
`
import classed from 'classed-components'
const extra = 'col s12 m6'
const Header = classed.div`
${props => props.needsHeader ? 'header' : 'box'}
green
${extra}
`
Please note that adding the className prop to a classed component will overwrite its class names.
const Header = classed.div`
test-class
`
// ...
// Do not do this:
<Header className='will-overwrite-test-class' />
FAQs
CSS Classes for the component age. Apply your Css with the power of Javascript.
The npm package classed-components receives a total of 9 weekly downloads. As such, classed-components popularity was classified as not popular.
We found that classed-components demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.