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

styled-system

Package Overview
Dependencies
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

styled-system - npm Package Compare versions

Comparing version 1.0.0-13 to 1.0.0-14

6

dist/util.js

@@ -21,2 +21,5 @@ 'use strict';

};
var em = function em(n) {
return num(n) ? n + 'em' : n;
};
var neg = function neg(n) {

@@ -35,3 +38,3 @@ return n < 0;

var mq = function mq(n) {
return '@media screen and (min-width: ' + n + 'em)';
return '@media screen and (min-width: ' + em(n) + ')';
};

@@ -66,2 +69,3 @@

px: px,
em: em,
neg: neg,

@@ -68,0 +72,0 @@ num: num,

2

package.json
{
"name": "styled-system",
"version": "1.0.0-13",
"version": "1.0.0-14",
"description": "Design system utilities for styled-components, glamorous, and other css-in-js libraries",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -220,2 +220,3 @@ # styled-system

The default set of breakpoints aims to cover a wide range of devices from mobile to desktop.
Breakpoints default to `em` but can be overridden by passing strings with unit appended.
Breakpoints can be customized using styled-components' [ThemeProvider](#configuration).

@@ -228,2 +229,7 @@

// @media screen and (min-width: 64em)
[ '300px', '600px', '1200px' ]
// @media screen and (min-width: 300px)
// @media screen and (min-width: 600px)
// @media screen and (min-width: 1200px)
```

@@ -257,2 +263,5 @@

As opposed to the built-in configurations, arrays given to the `breakpoints`, `space`, and
`fontSizes` theme properties can be of arbitrary lengths.
```jsx

@@ -259,0 +268,0 @@ import { ThemeProvider } from 'styled-components'

@@ -6,2 +6,3 @@ const { breakpoints } = require('./constants')

const px = n => num(n) ? n + 'px' : n
const em = n => num(n) ? n + 'em' : n
const neg = n => n < 0

@@ -11,3 +12,3 @@ const arr = n => Array.isArray(n) ? n : [ n ]

const mq = n => `@media screen and (min-width: ${n}em)`
const mq = n => `@media screen and (min-width: ${em(n)})`

@@ -37,2 +38,3 @@ const breaks = props => [

px,
em,
neg,

@@ -39,0 +41,0 @@ num,

@@ -55,2 +55,9 @@ import test from 'ava'

test('util.em adds em unit to numbers', t => {
const a = util.em(1)
const b = util.em('2px')
t.is(a, '1em')
t.is(b, '2px')
})
test('util.neg checks for negative number', t => {

@@ -109,2 +116,11 @@ const a = util.neg(0)

test('util.breaks accepts non-em breakpoints', t => {
const a = util.breaks({
theme: {
breakpoints: ["600px"],
},
})
t.deepEqual(a, [null, '@media screen and (min-width: 600px)'])
})
test('util.media returns media query wrapped rules', t => {

@@ -111,0 +127,0 @@ const a = util.media([])('hello')

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