![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Generate React components that automatically switch styles in response to prop changes.
import instyled from 'instyled'
const SomeComponent = instyled(d => {
d({ color: 'red' }) // default style
d(['hover'], { color: 'blue' })
d(['deactivated'], { color: 'gray' })
d(['hover', 'deactivated'], { color: 'lightgray' })
})
This will give you a new component SomeComponent
that accepts properties hover
and deactivated
. It will automatically switch to the specified styling for a given combination of "truthy" property values.
So
<SomeComponent/>
// -> <div style="color:red;"></div>
<SomeComponent deactivated={true} />
// -> <div style="color:gray;"></div>
<SomeComponent hover={true} />
// -> <div style="color:blue;"></div>
<SomeComponent hover={true} deactivated={true} />
// -> <div style="color:lightgray;"></div>
instyled
will figure out which style to apply for a given combination
Maybe the default API seems overly verbose to you. API's are hard to get right, but don't worry, you're covered. instyled
comes with two built-in input transformers and makes it pretty easy to write your own.
Each of these will give you the same results as the first example above.
import { instyledWithTransform, hierarchical } from 'instyled'
const instyled = instyledWithTransform(hierarchical)
const SomeComponent = instyled({
color: 'red',
hover: {
color: 'blue'
},
deactivated: {
color: 'gray',
hover: {
color: 'lightgray'
}
}
})
import { instyledWithTransform, flatKeyed } form 'instyled'
const instyled = instyledWithTransform(flatKeyed)
const SomeComponent = instyled({
$base: { color: 'red' },
hover: { color: 'blue' },
deactivated: { color: 'gray' },
'deactivated_hover': { color: 'grayer' }
})
FAQs
React inline styled component generator
The npm package instyled receives a total of 0 weekly downloads. As such, instyled popularity was classified as not popular.
We found that instyled demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.