Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fela-plugin-responsive-value

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fela-plugin-responsive-value - npm Package Compare versions

Comparing version 12.0.0-rc.2 to 12.0.0-rc.3.0

2

es/index.js

@@ -52,5 +52,5 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var properties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return function (style, type, renderer, props) {
return function responsiveValuePlugin(style, type, renderer, props) {
return resolveResponsiveValues(style, properties, getMediaQueries, props);
};
}

@@ -63,5 +63,5 @@ "use strict";

var properties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return function (style, type, renderer, props) {
return function responsiveValuePlugin(style, type, renderer, props) {
return resolveResponsiveValues(style, properties, getMediaQueries, props);
};
}
{
"name": "fela-plugin-responsive-value",
"version": "12.0.0-rc.2",
"version": "12.0.0-rc.3.0",
"description": "Fela plugin to resolve responsive array values",

@@ -61,3 +61,3 @@ "main": "lib/index.js",

},
"gitHead": "0e5e638041a6a62e52128dbac21e9c5f21d80b66"
"gitHead": "71e887614179a10c85332e326cf1d943ca51289a"
}

@@ -10,11 +10,13 @@ # fela-plugin-responsive-value

## Installation
```sh
yarn add fela-plugin-responsive-value
```
You may alternatively use `npm i --save fela-plugin-responsive-value`.
## Usage
Make sure to read the documentation on [how to use plugins](http://fela.js.org/docs/advanced/Plugins.html).
Make sure to read the documentation on [how to use plugins](https://fela.js.org/docs/latest/advanced/plugins#using-plugins).
```javascript

@@ -25,3 +27,3 @@ import { createRenderer } from 'fela'

const renderer = createRenderer({
plugins: [ responsiveValue() ]
plugins: [responsiveValue()],
})

@@ -31,9 +33,12 @@ ```

### Configuration
##### Parameters
| 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 |
|  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 |
##### Example
```javascript

@@ -47,15 +52,15 @@ import { createRenderer } from 'fela'

if (values.length === 2) {
return ["@media (min-width: 1024px)"]
return ['@media (min-width: 1024px)']
}
return ["@media (min-width: 800px)", "@media (min-width: 1024px)"]
return ['@media (min-width: 800px)', '@media (min-width: 1024px)']
}
const renderer = createRenderer({
plugins: [
plugins: [
responsiveValue(getMediaQueries, {
padding: true,
margin: true
})
]
margin: true,
}),
],
})

@@ -65,5 +70,7 @@ ```

## Example
Using the above example code:
#### Input
```javascript

@@ -75,3 +82,5 @@ {

```
#### Output
```javascript

@@ -92,4 +101,5 @@ {

## License
Fela is licensed under the [MIT License](http://opensource.org/licenses/MIT).<br>
Documentation is licensed under [Creative Commons License](http://creativecommons.org/licenses/by/4.0/).<br>
Created with ♥ by [@robinweser](http://weser.io) and all the great contributors.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc