Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
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,
position: 'absolute'
})
See the special cases for a list of px
-suffixed properties (same list is used in GreenSock API).
css(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)
A shorthand for setting multiple styles, where styles
is an object containing property:value
pairs.
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 215,933 weekly downloads. As such, dom-css popularity was classified as 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
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.