aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/ui/container.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-11-09 03:04:16 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-11-09 03:04:16 +0800
commitc27194a35783d966b27deeb1654a077b8c1ba1c8 (patch)
tree2b1deb57dcddf1c52bb7155836971be52d0b9fa3 /packages/instant/src/components/ui/container.tsx
parent6d5f65b77ede962b96ca59f30df1679a8216bd06 (diff)
parentadcfe51190c8ca5cd4d11e49eb7e100c80fbd16c (diff)
downloaddexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar
dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.gz
dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.bz2
dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.lz
dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.xz
dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.tar.zst
dexon-sol-tools-c27194a35783d966b27deeb1654a077b8c1ba1c8.zip
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/instant/prevent-css-leakage
Diffstat (limited to 'packages/instant/src/components/ui/container.tsx')
-rw-r--r--packages/instant/src/components/ui/container.tsx15
1 files changed, 9 insertions, 6 deletions
diff --git a/packages/instant/src/components/ui/container.tsx b/packages/instant/src/components/ui/container.tsx
index db3f32f92..bffa1d7d4 100644
--- a/packages/instant/src/components/ui/container.tsx
+++ b/packages/instant/src/components/ui/container.tsx
@@ -1,17 +1,18 @@
import { darken } from 'polished';
+import { MediaChoice, stylesForMedia } from '../../style/media';
import { ColorOption, styled } from '../../style/theme';
import { cssRuleIfExists } from '../../style/util';
export interface ContainerProps {
- display?: string;
+ display?: MediaChoice;
position?: string;
top?: string;
right?: string;
bottom?: string;
left?: string;
- width?: string;
- height?: string;
+ width?: MediaChoice;
+ height?: MediaChoice;
maxWidth?: string;
margin?: string;
marginTop?: string;
@@ -33,6 +34,7 @@ export interface ContainerProps {
cursor?: string;
overflow?: string;
darkenOnHover?: boolean;
+ flexGrow?: string | number;
}
export const Container =
@@ -42,14 +44,12 @@ export const Container =
&& {
all: initial;
box-sizing: border-box;
- ${props => cssRuleIfExists(props, 'display')}
+ ${props => cssRuleIfExists(props, 'flex-grow')}
${props => cssRuleIfExists(props, 'position')}
${props => cssRuleIfExists(props, 'top')}
${props => cssRuleIfExists(props, 'right')}
${props => cssRuleIfExists(props, 'bottom')}
${props => cssRuleIfExists(props, 'left')}
- ${props => cssRuleIfExists(props, 'width')}
- ${props => cssRuleIfExists(props, 'height')}
${props => cssRuleIfExists(props, 'max-width')}
${props => cssRuleIfExists(props, 'margin')}
${props => cssRuleIfExists(props, 'margin-top')}
@@ -67,6 +67,9 @@ export const Container =
${props => cssRuleIfExists(props, 'cursor')}
${props => cssRuleIfExists(props, 'overflow')}
${props => (props.hasBoxShadow ? `box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1)` : '')};
+ ${props => props.display && stylesForMedia('display', props.display)}
+ ${props => (props.width ? stylesForMedia('width', props.width) : '')}
+ ${props => (props.height ? stylesForMedia('height', props.height) : '')}
background-color: ${props => (props.backgroundColor ? props.theme[props.backgroundColor] : 'none')};
border-color: ${props => (props.borderColor ? props.theme[props.borderColor] : 'none')};
&:hover {