0.0.12 • Published 6 years ago
@arnat/styled-base v0.0.12
styled-base-components
Modular approach to use bootstrap components for quick prototypes, as an entrypoint of the component library.
Usage
This package contains basic global style for bootstrap layouts and
styled components for using utility classes from bootstrap.
This package also contains Transition components that can be used for
creating transitions.
import { styled } from 'styled-components';
import { BootstrapBaseCss, Div, Utilities } from '@arnat/styled-base';
// Same as imported <Div> components, but you may want to use this for
// styling existing components.
const MyComponent = styled.div`
${Utilities};
`;
const App = (props) => (
<div>
<BootstrapBaseCss />
{/* This installs bootstrap styling for html elements */}
<Div bgDark textLight p2>
Hello World
</Div>
<div>
);Properties
Transition
- transitionComponentProps Type: object
- delay Type: millisecods
- duration Type: milliseconds
- timingFunc Type: string
- noExit Type: boolean
- noEnter Type: boolean
- noInitialEnter Type: boolean
- hideOnExit Type: boolean
Utilities
Possible values for {size}:
- nothing (for
xs) Sm(forsm)Md(formd)Lg(forlg)Xl(forxl)vertical-align:
text{size}Baselinetext{size}Toptext{size}Bottomtext{size}TextToptext{size}TextBottom
- text-align:
text{size}Justifytext{size}Lefttext{size}Righttext{size}Center
- white-space:
text{size}Wraptext{size}NoWrap
- text-transform:
text{size}Lowercasetext{size}Uppercasetext{size}Capitalize
- font-weight:
text{size}WeightBoldtext{size}WeightBoldertext{size}WeightNormaltext{size}WeightLighttext{size}WeightLighter
- font-style:
text{size}Italic
- font-family:
text{size}Monospace
- color:
text{size}Primarytext{size}Secondarytext{size}Successtext{size}Dangertext{size}Warningtext{size}Infotext{size}Lighttext{size}Darktext{size}Darkertext{size}Reset
- background-color:
bg{size}Primarybg{size}Secondarybg{size}Successbg{size}Dangerbg{size}Warningbg{size}Infobg{size}Lightbg{size}Darkbg{size}Darkerbg{size}Whitebg{size}Transparent
- text-decoration:
textDecoration{size}None
- word-break + overflow-wrap:
text{size}WordBreak
- (max-)width/height:
w{size}100(width: 100%)w{size}75(width: 75%)w{size}50(width: 50%)w{size}25(width: 25%)h{size}100(height: 100%)h{size}75(height: 75%)h{size}50(height: 50%)h{size}25(height: 25%)mw{size}100(max-width: 100%)mw{size}75(max-width: 100%)mw{size}50(max-width: 100%)mw{size}25(max-width: 100%)mh{size}100(max-height: 25%)mh{size}75(max-height: 25%)mh{size}50(max-height: 25%)mh{size}25(max-height: 25%)
- box-shadow:
shadow{size}Noneshadow{size}Smallshadow{size}shadow{size}Large
- position:
position{size}Staticposition{size}Relativeposition{size}Absoluteposition{size}Fixedposition{size}Sticky
- overflow:
overflow{size}Autooverflow{size}Hidden
- float:
float{size}Rightfloat{size}Leftfloat{size}None
- resize:
resize{size}Noneresize{size}Bothresize{size}Verticalresize{size}Horizontal
- border:
borderLeft{size}borderRight{size}borderTop{size}borderBottom{size}border{size}borderLeft{size}0borderRight{size}0borderTop{size}0borderBottom{size}0border{size}0
- border-color:
border{size}Primaryborder{size}Secondaryborder{size}Successborder{size}Dangerborder{size}Warningborder{size}Infoborder{size}Lightborder{size}Darkborder{size}Darker
- border-radius:
roundedTop{size}roundedBottom{size}roundedLeft{size}roundedRight{size}rounded{size}rounded{size}Circlerounded{size}Pill
- display
d{size}Noned{size}Inlined{size}InlineBlockd{size}Blockd{size}Tabled{size}TableCelld{size}TableRowd{size}Flexd{size}InlineFlex
- flex-direction:
flex{size}Rowflex{size}RowReverseflex{size}Columnflex{size}ColumnReverse
- justify-content:
justifyContent{size}StartjustifyContent{size}EndjustifyContent{size}CenterjustifyContent{size}SpaceBetweenjustifyContent{size}SpaceAroundjustifyContent{size}SpaceEvenly
- align-items:
alignItems{size}StartalignItems{size}EndalignItems{size}CenteralignItems{size}BaselinealignItems{size}Stretch
- align-self:
alignSelf{size}StartalignSelf{size}EndalignSelf{size}CenteralignSelf{size}BaselinealignSelf{size}Stretch
- align-content:
alignContent{size}StartalignContent{size}EndalignContent{size}CenteralignContent{size}BaselinealignContent{size}Stretch
- order:
order{size}0order{size}1order{size}2order{size}3order{size}4order{size}5order{size}6order{size}7order{size}8order{size}9order{size}10order{size}11order{size}12
- flex-grow:
flexGrow{size}flexGrow{size}0
- flex-shrink:
flexShrink{size}flexShrink{size}0
- flex-wrap:
flexWrap{size}flexNoWrap{size}flexNoWrap{size}Reverse
- visibility:
visible{size}invisible{size}
- Clearfix
clearfix{size}
- Truncate text
text{size}Truncate
- Hide text
text{size}Hide
Spacing
Possible properties:
m=> marginp=> padding
Possible property directions:
l=> leftr=> rightt=> topb=> bottomx=> left and righty=> top and bottom
Possible values for spacing:
0,1,2,3,4,5,6,7,8,9
Results in "
value * 0.25rem"
Possible values for margin only:
n0,n1,n2,n3,n4,n5,n6,n7,n8,n9Auto
nmeans negative
Spacing props has format:
{property}{direction}{size}{value}Examples:
m1 (margin: 1*0.25rem)
mb3 (margin-bottom: 3*0.25rem)
mbn3 (margin-bottom: -3*0.25rem)
my3 (margin-top: 3*0.25rem; margin-bottom: 3*0.25rem)
pr2 (padding-right: 2*0.25rem)
pMd5 (@media (min-width: medium-screen-size) { padding: 5*0.25rem;})