diff --git a/README.md b/README.md index 95eab0d..5f2a23c 100644 --- a/README.md +++ b/README.md @@ -213,6 +213,7 @@ All of these CSS properties are supported. You can pass either a string or a num * `transitionProperty` * `transitionTimingFunction` * `userSelect` +* `verticalAlign` * `visibility` * `whiteSpace` * `width` diff --git a/src/enhancers/text.ts b/src/enhancers/text.ts index 5ef5724..de61568 100644 --- a/src/enhancers/text.ts +++ b/src/enhancers/text.ts @@ -17,6 +17,7 @@ export const propTypes: PropTypesMapping = { textOverflow: PropTypes.string, textShadow: PropTypes.string, textTransform: PropTypes.string, + verticalAlign: PropTypes.string, whiteSpace: PropTypes.string, wordBreak: PropTypes.string, wordWrap: PropTypes.string @@ -100,6 +101,12 @@ const lineHeight = { jsName: 'lineHeight', defaultUnit: '' } +const verticalAlign = { + className: 'ver-algn', + cssName: 'vertical-align', + jsName: 'verticalAlign', + safeValue: true +} const wordBreak = { className: 'wrd-brk', cssName: 'word-break', @@ -139,6 +146,7 @@ export const propEnhancers: PropEnhancers = { textOverflow: (value: PropEnhancerValueType) => getCss(textOverflow, value), textShadow: (value: PropEnhancerValueType) => getCss(textShadow, value), textTransform: (value: PropEnhancerValueType) => getCss(textTransform, value), + verticalAlign: (value: PropEnhancerValueType) => getCss(verticalAlign, value), whiteSpace: (value: PropEnhancerValueType) => getCss(whiteSpace, value), wordBreak: (value: PropEnhancerValueType) => getCss(wordBreak, value), wordWrap: (value: PropEnhancerValueType) => getCss(wordWrap, value) diff --git a/src/types/enhancers.ts b/src/types/enhancers.ts index 43d9099..a9ab753 100644 --- a/src/types/enhancers.ts +++ b/src/types/enhancers.ts @@ -131,6 +131,7 @@ type CssProps = Pick< | 'transitionProperty' | 'transitionTimingFunction' | 'userSelect' + | 'verticalAlign' | 'visibility' | 'whiteSpace' | 'width' diff --git a/test/snapshots/box.tsx.md b/test/snapshots/box.tsx.md index d62e1f2..95bb4b5 100644 --- a/test/snapshots/box.tsx.md +++ b/test/snapshots/box.tsx.md @@ -795,6 +795,9 @@ Generated by [AVA](https://ava.li). .ub-txt-trns_inherit {␊ text-transform: inherit;␊ }␊ + .ub-ver-algn_inherit {␊ + vertical-align: inherit;␊ + }␊ .ub-wht-spc_inherit {␊ white-space: inherit;␊ }␊ @@ -1197,6 +1200,9 @@ Generated by [AVA](https://ava.li). .ub-txt-trns_initial {␊ text-transform: initial;␊ }␊ + .ub-ver-algn_initial {␊ + vertical-align: initial;␊ + }␊ .ub-wht-spc_initial {␊ white-space: initial;␊ }␊ diff --git a/test/snapshots/box.tsx.snap b/test/snapshots/box.tsx.snap index 7081b56..9078d3f 100644 Binary files a/test/snapshots/box.tsx.snap and b/test/snapshots/box.tsx.snap differ diff --git a/tools/story.tsx b/tools/story.tsx index 8da2784..1a621f9 100644 --- a/tools/story.tsx +++ b/tools/story.tsx @@ -160,6 +160,7 @@ storiesOf('Box', module) Center Right + Middle Right sans-serif bold