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-plugin-responsive-value
Advanced tools
This plugin adds support for responsive values as pioneered by styled-system where one passes an array of values that later resolved to respective media queries.
Warning: This package might clash with fela-plugin-fallback-value and thus requires a list of whitelisted properties. We recommend using it before the fallback value.
yarn add fela-plugin-responsive-value
You may alternatively use npm i --save fela-plugin-responsive-value
.
Make sure to read the documentation on how to use plugins.
import { createRenderer } from 'fela'
import responsiveValue from 'fela-plugin-responsive-value'
const renderer = createRenderer({
plugins: [ responsiveValue() ]
})
Parameter | Value | Default | Description |
---|---|---|---|
getMediaQueries | (Function) | Resolve the list of media queries used based on the values and props | |
properties | (Object) | A map of property-boolean pairs of which properties are resolved |
import { createRenderer } from 'fela'
import responsiveValue from 'fela-plugin-responsive-value'
// if we have 2 values, use default and large media query
// if we get 3, also use a tablet media query in between
const getMediaQueries = (values, props) => {
if (values.length === 2) {
return ["@media (min-width: 1024px)"]
}
return ["@media (min-width: 800px)", "@media (min-width: 1024px)"]
}
const renderer = createRenderer({
plugins: [
responsiveValue(getMediaQueries, {
padding: true,
margin: true
})
]
})
Using the above example code:
{
margin: [0, 10]
padding: [5, 10, 15]
}
{
margin: 0,
padding: 5,
"@media (min-width: 800px)": {
padding: 10
},
"@media (min-width: 1024px)": {
margin: 10,
padding: 15
}
}
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 plugin to resolve responsive array values
The npm package fela-plugin-responsive-value receives a total of 0 weekly downloads. As such, fela-plugin-responsive-value popularity was classified as not popular.
We found that fela-plugin-responsive-value 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.