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.
Small module for fast and reliable DOM styling.
px
strings for common propertiesvar css = require('dom-css')
//set a style
css(element, 'position', 'absolute')
//will be set as "WebkitFontSmoothing" on Chrome
css(element, 'font-smoothing', 'none')
//set multiple styles
css(element, {
//can be camel or dash case
'background-color': 'blue',
//some properties use 'px' by default
left: 25,
top: 0,
marginTop: 0,
position: 'absolute'
})
//get the current style
css.get(element, 'position')
// -> 'absolute'
css.get(element, ['left', 'marginTop'])
// -> { left: '25px', marginTop: '0px' }
See the special cases for a list of px
-suffixed properties (same list is used in GreenSock API).
css(element, property, value)
css.set(element, property, value)
Styles an element with the css property
(dash or camel case) and a given value. value
is a string, or a number to be suffixed with 'px'
(special cases, see below).
css(element, styles)
css.set(element, styles)
A shorthand for setting multiple styles, where styles
is an object containing property:value
pairs.
css.get(element, prop)
Gets the inline style of element, where prop
is a string (like "borderRadius"
) or an array of strings. If an array of strings is given, an object is returned with key-value pairs representing the specified properties.
css.get(div, ['width', 'height']) => { width: "20px", height: "40px" }
Note: This does not provide the computed style!
The following properties are suffixed with 'px'
when their value is specified as a number.
top, right, bottom, left,
width, height, fontSize,
paddingLeft, paddingRight,
paddingTop, paddingBottom,
marginLeft, marginRight,
marginTop, marginBottom,
padding, margin, perspective
Special thanks to Paul Irish's gist for the prefix detection (now part of Modernizr).
MIT, see LICENSE.md for details.
FAQs
fast dom CSS styling
The npm package dom-css receives a total of 0 weekly downloads. As such, dom-css popularity was classified as not popular.
We found that dom-css 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
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.