@theme-ui/css
Advanced tools
Comparing version 0.4.0-rc.11 to 0.4.0-rc.13
@@ -21,2 +21,3 @@ import { CSSObject, ThemeUIStyleObject, Theme } from './types'; | ||
readonly opacity: "opacities"; | ||
readonly transition: "transitions"; | ||
readonly margin: "space"; | ||
@@ -23,0 +24,0 @@ readonly marginTop: "space"; |
@@ -68,2 +68,3 @@ function _extends() { | ||
opacity: 'opacities', | ||
transition: 'transitions', | ||
margin: 'space', | ||
@@ -70,0 +71,0 @@ marginTop: 'space', |
@@ -68,2 +68,3 @@ function _extends() { | ||
opacity: 'opacities', | ||
transition: 'transitions', | ||
margin: 'space', | ||
@@ -70,0 +71,0 @@ marginTop: 'space', |
@@ -0,1 +1,19 @@ | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
function get(obj, key, def, p, undef) { | ||
@@ -48,2 +66,3 @@ const path = key && typeof key === 'string' ? key.split('.') : [key]; | ||
opacity: 'opacities', | ||
transition: 'transitions', | ||
margin: 'space', | ||
@@ -192,3 +211,3 @@ marginTop: 'space', | ||
const transforms = ['margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginBlock', 'marginBlockEnd', 'marginBlockStart', 'marginInline', 'marginInlineEnd', 'marginInlineStart', 'top', 'bottom', 'left', 'right'].reduce((acc, curr) => ({ ...acc, | ||
const transforms = ['margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginBlock', 'marginBlockEnd', 'marginBlockStart', 'marginInline', 'marginInlineEnd', 'marginInlineStart', 'top', 'bottom', 'left', 'right'].reduce((acc, curr) => _extends({}, acc, { | ||
[curr]: positiveOrNegative | ||
@@ -235,5 +254,4 @@ }), {}); | ||
const css = (args = {}) => (props = {}) => { | ||
const theme = { ...defaultTheme, | ||
...('theme' in props ? props.theme : props) | ||
}; | ||
const theme = _extends({}, defaultTheme, 'theme' in props ? props.theme : props); | ||
let result = {}; | ||
@@ -249,5 +267,3 @@ const obj = typeof args === 'function' ? args(theme) : args; | ||
const variant = css(get(theme, val))(theme); | ||
result = { ...result, | ||
...variant | ||
}; | ||
result = _extends({}, result, variant); | ||
continue; | ||
@@ -254,0 +270,0 @@ } |
@@ -73,2 +73,3 @@ (function (global, factory) { | ||
opacity: 'opacities', | ||
transition: 'transitions', | ||
margin: 'space', | ||
@@ -75,0 +76,0 @@ marginTop: 'space', |
@@ -577,2 +577,3 @@ import * as CSS from 'csstype'; | ||
opacities?: Scale<CSS.OpacityProperty>; | ||
transitions?: Scale<CSS.TransitionProperty>; | ||
/** | ||
@@ -579,0 +580,0 @@ * Enable/disable custom CSS properties/variables if lower browser |
{ | ||
"name": "@theme-ui/css", | ||
"version": "0.4.0-rc.11", | ||
"version": "0.4.0-rc.13", | ||
"source": "src/index.ts", | ||
@@ -22,3 +22,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "7a97b423774254db514139cb557d8636d5231725" | ||
"gitHead": "77155d2d7615ea50bec8e206625ad0b33d618de0" | ||
} |
@@ -68,2 +68,3 @@ import { | ||
opacity: 'opacities', | ||
transition: 'transitions', | ||
margin: 'space', | ||
@@ -70,0 +71,0 @@ marginTop: 'space', |
@@ -622,2 +622,3 @@ import * as CSS from 'csstype' | ||
opacities?: Scale<CSS.OpacityProperty> | ||
transitions?: Scale<CSS.TransitionProperty> | ||
@@ -624,0 +625,0 @@ /** |
@@ -56,2 +56,5 @@ import { css, Theme } from '../src' | ||
opacities: [0, '50%'], | ||
transitions: { | ||
standard: '0.3s ease-in-out' | ||
} | ||
} | ||
@@ -154,2 +157,3 @@ | ||
opacity: 1, | ||
transition: 'standard', | ||
fontFamily: 'monospace', | ||
@@ -172,2 +176,3 @@ lineHeight: 'body', | ||
opacity: '50%', | ||
transition: '0.3s ease-in-out', | ||
fontFamily: 'Menlo, monospace', | ||
@@ -174,0 +179,0 @@ fontSize: 24, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
290909
5047