Skip to content

Commit f991b6a

Browse files
committed
Use theme-ui/css in core
1 parent 5501fbb commit f991b6a

File tree

11 files changed

+11
-15
lines changed

11 files changed

+11
-15
lines changed

packages/css/src/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const get = (obj, key, def, p, undef) => {
88

99
const defaultBreakpoints = [40, 52, 64].map(n => n + 'em')
1010

11-
export const defaultTheme = {
11+
const defaultTheme = {
1212
space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
1313
fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 72],
1414
}
@@ -147,7 +147,7 @@ const transforms = [
147147
{}
148148
)
149149

150-
export const responsive = styles => theme => {
150+
const responsive = styles => theme => {
151151
const next = {}
152152
const breakpoints = get(theme, 'breakpoints', defaultBreakpoints)
153153
const mediaQueries = [
@@ -219,5 +219,3 @@ export const css = args => (props = {}) => {
219219

220220
return result
221221
}
222-
223-
export default css

packages/css/test/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import css from '../src'
1+
import { css } from '../src'
22

33
const theme = {
44
colors: {

packages/theme-ui/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ help you build UI rooted in constraint-based design principles.
5353
[mdx]: https://mdxjs.com
5454
[styled system]: https://styled-system.com
5555
[gatsby]: https://gatsbyjs.org
56-
[@styled-system/css]: https://styled-system.com/css
5756
[theme specification]: https://system-ui.com/theme
5857
[typography.js]: https://github.com/KyleAMathews/typography.js
5958

@@ -123,7 +122,6 @@ export default props => (
123122
)
124123
```
125124

126-
Under the hood, this uses the [`@styled-system/css`](https://styled-system.com/css) utility and Emotion's custom JSX pragma implementation.
127125
Read more about [how the custom pragma works](https://theme-ui.com/how-it-works/#jsx-pragma).
128126

129127
## Responsive styles

packages/theme-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"dependencies": {
2020
"@emotion/is-prop-valid": "^0.8.1",
21-
"@styled-system/css": "^5.0.16",
21+
"@theme-ui/css": "^0.2.48",
2222
"deepmerge": "^4.0.0"
2323
},
2424
"devDependencies": {

packages/theme-ui/src/color-modes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState, useEffect } from 'react'
2-
import { css } from '@styled-system/css'
2+
import { css } from '@theme-ui/css'
33
import { Global } from '@emotion/core'
44
import { useThemeUI } from './context'
55
import { createColorStyles } from './custom-properties'

packages/theme-ui/src/custom-properties.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// convert theme and style objects to CSS custom properties
2-
import { css } from '@styled-system/css'
2+
import { css } from '@theme-ui/css'
33

44
const toVarName = key => `--theme-ui-${key}`
55
const toVarValue = (key, value) => `var(${toVarName(key)}, ${value})`

packages/theme-ui/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ export { ColorMode, useColorMode, InitializeColorMode } from './color-modes'
55
export { Styled, components } from './components'
66
export { Box, Flex, Layout, Header, Main, Container, Footer } from './layout'
77
export { BaseStyles } from './base-styles'
8-
export { css, get } from '@styled-system/css'
8+
export { css, get } from '@theme-ui/css'

packages/theme-ui/src/jsx.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { jsx as emotion } from '@emotion/core'
2-
import css from '@styled-system/css'
2+
import { css } from '@theme-ui/css'
33

44
const getCSS = props => {
55
if (!props.sx && !props.css) return undefined

packages/theme-ui/src/provider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useEffect, useReducer } from 'react'
22
import { ThemeContext as EmotionContext } from '@emotion/core'
33
import { version as emotionVersion } from '@emotion/core/package.json'
44
import { MDXProvider } from '@mdx-js/react'
5-
import { get } from '@styled-system/css'
5+
import { get } from '@theme-ui/css'
66
import merge from './merge'
77
import jsx from './jsx'
88
import { Context, useThemeUI } from './context'

packages/theme-ui/src/themed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { css, get } from '@styled-system/css'
1+
import { css, get } from '@theme-ui/css'
22

33
export const themed = key => props =>
44
css(get(props.theme, `styles.${key}`))(props.theme)

0 commit comments

Comments
 (0)