Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
npm install glam
.css
filesname: myButton;
)input -
// index.js
import css from 'glam'
let myColor = '#ab67ee'
let radius = '20px'
let myclass = css`
color: red;
&:hover {
font-weight: bold;
color: ${myColor};
border-radius: ${radius};
}
`
output -
// index.js
import('./index.js.css')
// defaults to async load
// sync load with explicit require('./index.js.css')
import css from 'glam'
let myColor = '#ab67ee'
let radius = '20px'
let myClass = css('css-1bh6s', [myColor, radius]) // "css-1bh6s vars-h23psd"
/* index.js.css */
.css-1bh6s {
color: red
}
.css-1bh6s:hover {
font-weight: bold;
color: var(--css-1bh6s-0);
border-radius: var(--css-1bh6s-1);
}
/* dynamically added */
.vars-h23psd {
--css-1bh6s-0: #ab67ee;
--css-1bh6s-1: 20px;
}
glam/babel
to your babel pluginsglam/loader
to webpack's css loaderssync
- true
/false
- loads css synchronously, preventing foucinline
- true/false
- fallback for browsers that don't support css props.you could define your own variant, bringing down runtime cost further
(react@16.alpha-11 and above)
function css(cls, vars = []){
return {
className: cls,
style: vars.reduce((o, v, i) =>
(o[`--${cls}-${i}`] = v, o), {})
}
}
// ...
<div {...css` font-weight:bold; color: ${props.color}; `}>
hello!
</div>
FAQs
inline css for your jsx
The npm package glam receives a total of 7,651 weekly downloads. As such, glam popularity was classified as popular.
We found that glam demonstrated a not healthy version release cadence and project activity because the last version was released 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
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.