mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-30 01:16:24 +00:00
[change] W3C verticalAlign style
* Add support for verticalAlign style. * Deprecate textAlignVertical style. Ref #2379
This commit is contained in:
committed by
Nicolas Gallagher
parent
c6e77c36af
commit
5bc51420a8
Vendored
+11
@@ -215,6 +215,17 @@ describe('compiler/createReactDOMStyle', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('verticalAlign', () => {
|
||||
expect(
|
||||
createReactDOMStyle({
|
||||
verticalAlign: 'top',
|
||||
textAlignVertical: 'center'
|
||||
})
|
||||
).toEqual({
|
||||
verticalAlign: 'top'
|
||||
});
|
||||
});
|
||||
|
||||
describe('transform', () => {
|
||||
// passthrough if transform value is ever a string
|
||||
test('string', () => {
|
||||
|
||||
+7
-1
@@ -167,7 +167,13 @@ const createReactDOMStyle = (style: Style, isInline?: boolean): Style => {
|
||||
resolvedStyle[prop] = value;
|
||||
}
|
||||
} else if (prop === 'textAlignVertical') {
|
||||
resolvedStyle.verticalAlign = value === 'center' ? 'middle' : value;
|
||||
warnOnce(
|
||||
'textAlignVertical',
|
||||
'"textAlignVertical" style is deprecated. Use "verticalAlign".'
|
||||
);
|
||||
if (resolvedStyle.verticalAlign == null) {
|
||||
resolvedStyle.verticalAlign = value === 'center' ? 'middle' : value;
|
||||
}
|
||||
} else if (prop === 'textDecorationLine') {
|
||||
// use 'text-decoration' for browsers that only support CSS2
|
||||
// text-decoration (e.g., IE, Edge)
|
||||
|
||||
+5
-2
@@ -52,7 +52,6 @@ export type TextStyle = {
|
||||
| 'left'
|
||||
| 'right'
|
||||
| 'start',
|
||||
textAlignVertical?: ?string,
|
||||
textDecorationColor?: ?ColorValue,
|
||||
textDecorationLine?:
|
||||
| 'none'
|
||||
@@ -67,6 +66,7 @@ export type TextStyle = {
|
||||
| 'geometricPrecision'
|
||||
| 'optimizeLegibility'
|
||||
| 'optimizeSpeed',
|
||||
textShadow?: ?string,
|
||||
textShadowColor?: ?ColorValue,
|
||||
textShadowOffset?: {| width?: number, height?: number |},
|
||||
textShadowRadius?: ?number,
|
||||
@@ -79,13 +79,16 @@ export type TextStyle = {
|
||||
| 'isolate-override'
|
||||
| 'plaintext',
|
||||
userSelect?: 'none' | 'text',
|
||||
verticalAlign?: ?string,
|
||||
whiteSpace?: ?string,
|
||||
wordBreak?: 'normal' | 'break-all' | 'break-word' | 'keep-all',
|
||||
wordWrap?: ?string,
|
||||
writingDirection?: 'auto' | 'ltr' | 'rtl',
|
||||
/* @platform web */
|
||||
MozOsxFontSmoothing?: ?string,
|
||||
WebkitFontSmoothing?: ?string
|
||||
WebkitFontSmoothing?: ?string,
|
||||
// deprecated
|
||||
textAlignVertical?: ?string
|
||||
};
|
||||
|
||||
export type TextProps = {
|
||||
|
||||
@@ -253,6 +253,7 @@ export type LayoutStyles = {|
|
||||
*/
|
||||
|
||||
export type ShadowStyles = {|
|
||||
// @deprecated
|
||||
shadowColor?: ?ColorValue,
|
||||
shadowOffset?: {|
|
||||
width?: DimensionValue,
|
||||
|
||||
Reference in New Issue
Block a user