Skip to content

Commit

Permalink
feat: add support for text-shadow (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlweb authored and gregberge committed Aug 28, 2019
1 parent 0061b90 commit 96ef25a
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 12 deletions.
1 change: 1 addition & 0 deletions packages/core/src/propGetters.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export const propGetters = {

// getShadow
'box-shadow': getShadow,
'text-shadow': getShadow,

// getSize
width: getNumberSize,
Expand Down
11 changes: 0 additions & 11 deletions packages/system/src/styles/borders.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ export const getBorderStyle = themeGetter({
key: 'borderStyles',
})

export const getShadow = themeGetter({
name: 'shadow',
key: 'shadows',
})

// Style

export const border = style({
Expand Down Expand Up @@ -94,11 +89,6 @@ export const borderRadius = style({
themeGet: getRadius,
})

export const boxShadow = style({
prop: 'boxShadow',
themeGet: getShadow,
})

export const borders = compose(
border,
borderTop,
Expand All @@ -113,5 +103,4 @@ export const borders = compose(
borderWidth,
borderStyle,
borderRadius,
boxShadow,
)
3 changes: 3 additions & 0 deletions packages/system/src/styles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { layout } from './layout'
import { flexboxes } from './flexboxes'
import { grids } from './grids'
import { positioning } from './positioning'
import { shadows } from './shadows'
import { space } from './space'
import { typography } from './typography'
import { xgrids } from './xgrids'
Expand All @@ -17,6 +18,7 @@ export * from './flexboxes'
export * from './grids'
export * from './layout'
export * from './positioning'
export * from './shadows'
export * from './space'
export * from './typography'
export * from './xgrids'
Expand All @@ -29,6 +31,7 @@ export const system = compose(
grids,
layout,
positioning,
shadows,
space,
typography,
xgrids,
Expand Down
25 changes: 25 additions & 0 deletions packages/system/src/styles/shadows.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { style, themeGetter, compose } from '../style'

// Getters

export const getShadow = themeGetter({
name: 'shadow',
key: 'shadows',
})

// Style

export const boxShadow = style({
prop: 'boxShadow',
themeGet: getShadow,
})

export const textShadow = style({
prop: 'textShadow',
themeGet: getShadow,
})

export const shadows = compose(
boxShadow,
textShadow,
)
8 changes: 7 additions & 1 deletion website/src/pages/docs/system-props.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,15 @@ Available border utilities:
- `borderWidth`
- `borderStyle`
- `borderRadius`
- `boxShadow`
- `borders`: all border utilities

## Shadows

Available shadow utilities:

- `boxShadow`
- `textShadow`

## Basics

Available basic utilities:
Expand Down

0 comments on commit 96ef25a

Please sign in to comment.