Socket
Socket
Sign inDemoInstall

styled-system

Package Overview
Dependencies
7
Maintainers
2
Versions
149
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0-0 to 4.0.0

public/_/index.html

9

CHANGELOG.md

@@ -5,10 +5,11 @@ # Changelog

## v4.0.0 2019-02-23
- Rewritten core for less code duplication
- No longer merges returned style object, but returns arrays instead, which appear to work with common CSS-in-JS libraries
- No longer merges returned style object, but returns arrays instead, which should work with common CSS-in-JS libraries
- `space` function has been rewritten with the core `style` and `compose` utilities
- Adds long-form props for margin and padding (e.g. `marginTop`). Shorthand aliases still work as before.
- Reintroduced the `alias` argument to `style` utility
- Reintroduces the `alias` argument to `style` utility
- Removes the `styles` object export
- Removes the `util` object export
- Removes `meta` field from propTypes, which was used in system-docs
- Removes `merge` utility

@@ -22,2 +23,4 @@ - Removes the `mixed` utility since it did not behave as expected

- All border props are also available as individual imports
- Removes `styleType` from prop types `meta` fields
- Changes to the `get` utility: now returns the last argument as a fallback

@@ -24,0 +27,0 @@ ## v3.2.1 2019-01-02

@@ -12,15 +12,2 @@ "use strict";

// v4 prototype
//
// - Returns arrays of styles for responsive and composed styles. This should work the same as before when combined with CSS-in-JS libraries like styled-components and emotion
// - Refactors `space` function to use core `style` function
// - Adds long-hand props for margin and padding. Shorthand aliases still work.
// - The get utility works differently, returning the last argument as a fallback.
// - Removes the `styles` export
// - Removes `meta` field from `propTypes` - this was used by system-docs. An alternative/optional object export for documentation will be added
// - Removes the `merge` utility
// - Removes `mixed` utility
// - The theme scale is passed as the second argument to the `transformValue` option in `style`
// - Removes `ratio` function
// - Changes to border functions
var defaultBreakpoints = [40, 52, 64].map(function (n) {

@@ -120,3 +107,2 @@ return n + 'em';

var func = function func(props) {
// TODO write some tests for this
var value = get(props, prop, alias, null);

@@ -173,3 +159,15 @@ if (!is(value)) return null;

func.propTypes = (_func$propTypes = {}, _func$propTypes[prop] = cloneFunction(propType), _func$propTypes);
if (alias) func.propTypes[alias] = cloneFunction(propType);
func.propTypes[prop].meta = {
prop: prop,
themeKey: key
};
if (alias) {
func.propTypes[alias] = cloneFunction(propType);
func.propTypes[alias].meta = {
prop: alias,
themeKey: key
};
}
return func;

@@ -555,3 +553,2 @@ };

}); // borders
// export const getBorder = (n, scale) =>

@@ -558,0 +555,0 @@ exports.gridArea = gridArea;

import _extends from "@babel/runtime/helpers/esm/extends";
// v4 prototype
//
// - Returns arrays of styles for responsive and composed styles. This should work the same as before when combined with CSS-in-JS libraries like styled-components and emotion
// - Refactors `space` function to use core `style` function
// - Adds long-hand props for margin and padding. Shorthand aliases still work.
// - The get utility works differently, returning the last argument as a fallback.
// - Removes the `styles` export
// - Removes `meta` field from `propTypes` - this was used by system-docs. An alternative/optional object export for documentation will be added
// - Removes the `merge` utility
// - Removes `mixed` utility
// - The theme scale is passed as the second argument to the `transformValue` option in `style`
// - Removes `ratio` function
// - Changes to border functions
import PropTypes from 'prop-types';

@@ -82,3 +69,2 @@ export var defaultBreakpoints = [40, 52, 64].map(function (n) {

var func = function func(props) {
// TODO write some tests for this
var value = get(props, prop, alias, null);

@@ -135,3 +121,15 @@ if (!is(value)) return null;

func.propTypes = (_func$propTypes = {}, _func$propTypes[prop] = cloneFunction(propType), _func$propTypes);
if (alias) func.propTypes[alias] = cloneFunction(propType);
func.propTypes[prop].meta = {
prop: prop,
themeKey: key
};
if (alias) {
func.propTypes[alias] = cloneFunction(propType);
func.propTypes[alias].meta = {
prop: alias,
themeKey: key
};
}
return func;

@@ -448,3 +446,2 @@ };

}); // borders
// export const getBorder = (n, scale) =>

@@ -451,0 +448,0 @@ export var border = style({

{
"name": "styled-system",
"version": "4.0.0-0",
"version": "4.0.0",
"description": "Responsive, theme-based style props for building design systems with React",

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

@@ -188,3 +188,4 @@

- [Utilities](docs/api.md#utilities)
- [get](docs/api.md#get)
- [themeGet](docs/api.md#themeget)
- [propTypes](docs/api.md#proptypes)
- [Customize](docs/api.md#customize)

@@ -191,0 +192,0 @@ - [style](docs/api.md#style)

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc