Socket
Socket
Sign inDemoInstall

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-6 to 1.0.0-7

5

dist/color.js

@@ -29,5 +29,8 @@ 'use strict';

return function (n) {
return obj[n] || n;
return idx(getKeys(n), obj) || n;
};
};
var getKeys = function getKeys(n) {
return typeof n === 'string' ? n.split('.') : [n];
};

@@ -34,0 +37,0 @@ var properties = {

3

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

@@ -30,2 +30,3 @@ "main": "dist/index.js",

"grid-styled": "^2.0.0-2",
"palx": "^1.0.2",
"react": "^15.6.0",

@@ -32,0 +33,0 @@ "react-dom": "^15.6.0",

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

<Box color='tomato' />
<Box color='grays.0' />

@@ -130,3 +131,3 @@ // background color

By default the raw value of the prop is returned.
Color palettes can be configured with the [ThemeProvider](#configuration) to use keys as prop values.
Color palettes can be configured with the [ThemeProvider](#configuration) to use keys as prop values, with support for dot notation.
Array values are converted into [responsive values](#responsive-styles).

@@ -133,0 +134,0 @@

@@ -21,3 +21,4 @@ const { breaks, idx, merge, arr, dec, media } = require('./util')

const cx = obj => n => obj[n] || n
const cx = obj => n => idx(getKeys(n), obj) || n
const getKeys = n => typeof n === 'string' ? n.split('.') : [ n ]

@@ -24,0 +25,0 @@ const properties = {

import test from 'ava'
import palx from 'palx'
import {

@@ -11,2 +12,4 @@ space,

const palette = palx('#07c')
const theme = {

@@ -412,2 +415,12 @@ breakpoints: [32, 48, 64],

test('color keys support dot notation', t => {
const a = color({
theme: {
colors: palette
},
color: 'gray.2'
})
t.is(a.color, palette.gray[2])
})
test('breakpoints can be configured with a theme', t => {

@@ -414,0 +427,0 @@ const a = space({theme, m: [1, 2, 3, 4]})

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