![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.
CSS in JS with Style
npm install --save-dev sprayer
Sprayer allows you to write modular, scoped CSS with all the features of JavaScript template strings. It is heavily influenced by CSS Modules, styled-components and CSJS.
import $ from 'jquery'
import sprayer from 'sprayer'
// Create a spray
const spray = sprayer`
.headline {
color: darkcyan;
font-size: ${(fontSize) => fontSize}rem;
// ^^^^^^^^^^^^^^^^^^^^^^
// This interpolation will be called with the arguments passed to the spray
// In this example it will be called with 3 for the h1 and with 2 for the h2 elements
}
`
$('h1').addClass(spray(3).headline)
$('h2').addClass(spray(2).headline)
import sprayer from 'sprayer'
The whole API is one single function. You should tag your template string with this function to get a spray. A spray is a function which will take a list of parameters. If you have interpolations in your template string which are functions they will be called with the parameters you supplied to the spray. After you called the spray it will hash the CSS, scope all classes with this hash and then return you an object which will have all classes and their scoped counterparts as keys and values. You can then use this object to inject the classes into the DOM. In the background sprayer already injected the styles into the DOM. There will be a special method called .dispose()
in the object. You should call this method if you don't need the style anymore.
I am highly appreciating if you want to help me with this project. Check out the issues with the help wanted
label to see where your hel
p is needed.
FAQs
CSS in JS with Style
The npm package sprayer receives a total of 0 weekly downloads. As such, sprayer popularity was classified as not popular.
We found that sprayer 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.