![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@isiahmeadows/min-style
Advanced tools
A simple, small (~1.7k min+gzip), sweet CSS-in-JS solution, that happens to be fully isomorphic and runtime-independent (except for CSS injection), falling back to and implemented in pure ES5. It is also compatible with jQuery, Zepto, and many other similar libraries (detected by a .get()
method).
You can install this from npm:
npm install --save @isiahmeadows/min-style
You can also use min-style.js
or min-style.min.js
from here directly.
(Yes, it's a scoped package. Don't worry, it's correct, and you can use it like any other npm module.)
It's exposed as a UMD module, presenting both CommonJS and AMD variants, as well as a global version for <script>
inclusion, which exposes itself as minStyle
.
// Node.js/Webpack/etc.
const minStyle = require("@isiahmeadows/min-style")
// RequireJS
define(["min-style"], function (minStyle) {
// ...
})
And for an example stylesheet, totally not ripped from Stylus's examples:
function stripe(even = "#fff", odd = "#eee") {
return [
["tr", [
["background-color", odd],
[["&.even", "&:nth-child(even)"], [
["background-color", even]
]]
]]
]
}
const styles = minStyle.add([
["table", [
[stripe],
["td", [
["padding", "4px 10px"],
]]
]],
["table#users", [
[stripe, "#303030", "#494848"],
["td", [
["color", "white"]
]]
]]
])
minStyle.inject() // whenever you're ready
[".selector", [
// ...
[".nested :global(.btn.btn-warning)", [
// ...
]]
]]
Add a CSS selector rule. These may be nested, and they accept media and font-face queries at any point, and an object is returned containing key-value pairs for the detected classes and IDs to their generated equivalents.
Notes:
:global(.foo.bar)
to break from this.{name}__{16 random digits}
["color", "red"]
["border-color", "blue"]
["background-color", "green", "linear-gradient(...)"]
Set CSS properties. Add more than one value to add fallbacks.
const styles = minStyle.add([
[".selector", [
// ...
]]
// ...
])
Create a combined CSS fragment. It returns a mapping of all non-global classes detected to their uniquified variants.
[mixin, ...opts]
Apply a mixin with various opts. A mixin is simply a function accepting the passed options proxied through and returning an array of 0 or more selectors, properties, mixin calls, etc.
const css = minStyle.render()
Render the CSS to a string, for whatever your needs are.
const detach = minStyle.inject(parent=document.head)
// ...
detach()
Inject the CSS into the DOM, optionally into a parent. Call detach
to detach the previously injected CSS.
const factory = minStyle.init({...opts})
Create a new instance of this library, potentially with various options set. Here's the following options accepted:
opts.parent
- The parent element or jQuery instance to append the style element to, defaulting lazily to document.head
.opts.prop(key, value)
- Called on each property, before emitting. Return an object or array of objects to change this.opts.atRule(key, rule)
- Called on each at-rule, before emitting. Return an object or array of objects to change this.opts.rule(key, rule)
- Called on each rule, before emitting. Return an object or array of objects to change this.The following license (ISC License), unless otherwise stated:
Copyright (c) 2016 and later, Isiah Meadows me@isiahmeadows.com.
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
FAQs
A simple, small, sweet CSS-in-JS solution
We found that @isiahmeadows/min-style 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
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.