Security News
RubyGems.org Adds New Maintainer Role
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.
fela-enforce-longhands
Advanced tools
Fela enhancer that enforces longhand over shorthand properties
This enhancers implements are specific propertyPriority
configuration that enforces longhand over shorthand properties. This enforces a certain order, but makes it deterministic which helps to prevent issues.
For example, paddingLeft
will always overwrite the padding-left
value from a padding
property, no matter in which order they are rendered.
It uses a clever CSS specificity trick where repeated selectors increase the specificity and thus a prioritized over others.
For example, if we render the following style:
const style = {
paddingLeft: 10,
padding: 5,
}
the following CSS will be rendered respectively:
.a.a {
padding-left: 10px;
}
.b {
padding: 5px;
}
Check Selectors Level 3 for more information.
yarn add fela-enforce-longhands
You may alternatively use npm i --save fela-enforce-longhands
.
import { createRenderer } from 'fela'
import enforceLonghands from 'fela-enforce-longhands'
const renderer = createRenderer({
enhancers: [enforceLonghands()],
})
Property | Type | Default | Description |
---|---|---|---|
borderMode | none | directional | longhand | none | Defines which border properties take priority.none will treat both second level properties (e.g. border-width or border-top ) the same.directional will prioritize e.g. border-top over border-width longhand will prioritize e.g. border-width over border-top |
import { createRenderer } from 'fela'
import enforceLonghands from 'fela-enforce-longhands'
const renderer = createRenderer({
enhancers: [
enforceLonghands({
borderMode: 'directional',
}),
],
})
Fela is licensed under the MIT License.
Documentation is licensed under Creative Commons License.
Created with ♥ by @robinweser and all the great contributors.
FAQs
Fela enhancer that enforces longhand over shorthand properties
The npm package fela-enforce-longhands receives a total of 0 weekly downloads. As such, fela-enforce-longhands popularity was classified as not popular.
We found that fela-enforce-longhands 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
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.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.