Skip to content

Commit

Permalink
[change] Replace outline with outline{Color,Style,Width} styles
Browse files Browse the repository at this point in the history
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
  • Loading branch information
necolas committed Mar 12, 2019
1 parent c68b532 commit f048d84
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import InteractionPropTypes from '../../modules/InteractionPropTypes';
import LayoutPropTypes from '../../modules/LayoutPropTypes';
import ShadowPropTypes from '../../modules/ShadowPropTypes';
import TransformPropTypes from '../../modules/TransformPropTypes';
import { number, oneOf, string } from 'prop-types';
import { number, oneOf, oneOfType, string } from 'prop-types';

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

const ViewStylePropTypes = {
Expand Down Expand Up @@ -47,8 +48,10 @@ const ViewStylePropTypes = {
boxShadow: string,
clip: string,
filter: string,
outline: string,
outlineColor: ColorPropType,
outlineOffset: stringOrNumber,
outlineStyle: string,
outlineWidth: stringOrNumber,
overscrollBehavior: overscrollBehaviorType,
overscrollBehaviorX: overscrollBehaviorType,
overscrollBehaviorY: overscrollBehaviorType,
Expand Down
16 changes: 13 additions & 3 deletions packages/website/storybook/1-components/View/ViewScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -732,13 +732,23 @@ const stylePropTypes = [
},
{
label: 'web',
name: 'outline',
name: 'outlineColor',
typeInfo: 'color'
},
{
label: 'web',
name: 'outlineOffset',
typeInfo: 'number | string'
},
{
label: 'web',
name: 'outlineStyle',
typeInfo: 'string'
},
{
label: 'web',
name: 'outlineColor',
typeInfo: 'color'
name: 'outlineWidth',
typeInfo: 'number | string'
},
{
name: 'overflow',
Expand Down
3 changes: 1 addition & 2 deletions packages/website/storybook/3-demos/Calculator/Calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ const calculatorKeyStyles = StyleSheet.create({
borderTopStyle: 'solid',
borderRightWidth: 1,
borderRightColor: '#666',
borderRightStyle: 'solid',
outline: 'none'
borderRightStyle: 'solid'
},
text: {
fontWeight: '100',
Expand Down

0 comments on commit f048d84

Please sign in to comment.