Skip to content

Commit f048d84

Browse files
committed
[change] Replace outline with outline{Color,Style,Width} styles
Rather than mix shortform and longform properties, the 'outline' property is removed in favour of the longform properties. Support for `outlineOffset` is also included. Fix #1255 Close #1256
1 parent c68b532 commit f048d84

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

packages/react-native-web/src/exports/View/ViewStylePropTypes.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ import InteractionPropTypes from '../../modules/InteractionPropTypes';
1515
import LayoutPropTypes from '../../modules/LayoutPropTypes';
1616
import ShadowPropTypes from '../../modules/ShadowPropTypes';
1717
import TransformPropTypes from '../../modules/TransformPropTypes';
18-
import { number, oneOf, string } from 'prop-types';
18+
import { number, oneOf, oneOfType, string } from 'prop-types';
1919

20+
const stringOrNumber = oneOfType([string, number]);
2021
const overscrollBehaviorType = oneOf(['auto', 'contain', 'none']);
2122

2223
const ViewStylePropTypes = {
@@ -47,8 +48,10 @@ const ViewStylePropTypes = {
4748
boxShadow: string,
4849
clip: string,
4950
filter: string,
50-
outline: string,
5151
outlineColor: ColorPropType,
52+
outlineOffset: stringOrNumber,
53+
outlineStyle: string,
54+
outlineWidth: stringOrNumber,
5255
overscrollBehavior: overscrollBehaviorType,
5356
overscrollBehaviorX: overscrollBehaviorType,
5457
overscrollBehaviorY: overscrollBehaviorType,

packages/website/storybook/1-components/View/ViewScreen.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -732,13 +732,23 @@ const stylePropTypes = [
732732
},
733733
{
734734
label: 'web',
735-
name: 'outline',
735+
name: 'outlineColor',
736+
typeInfo: 'color'
737+
},
738+
{
739+
label: 'web',
740+
name: 'outlineOffset',
741+
typeInfo: 'number | string'
742+
},
743+
{
744+
label: 'web',
745+
name: 'outlineStyle',
736746
typeInfo: 'string'
737747
},
738748
{
739749
label: 'web',
740-
name: 'outlineColor',
741-
typeInfo: 'color'
750+
name: 'outlineWidth',
751+
typeInfo: 'number | string'
742752
},
743753
{
744754
name: 'overflow',

packages/website/storybook/3-demos/Calculator/Calculator.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ const calculatorKeyStyles = StyleSheet.create({
126126
borderTopStyle: 'solid',
127127
borderRightWidth: 1,
128128
borderRightColor: '#666',
129-
borderRightStyle: 'solid',
130-
outline: 'none'
129+
borderRightStyle: 'solid'
131130
},
132131
text: {
133132
fontWeight: '100',

0 commit comments

Comments
 (0)