EvoKit - Body
Used for body of the web page and sets the basic styles. Contains two elements <Body>
and <Body.Section>
Install
npm install evokit-body --save
Usage
More about usage
import React from 'react';import Body from 'evokit-body';import 'evokit-body/style.css'; const App = <Body ='xl'> <Body.Section> header </Body.Section> <Body.Section> content </Body.Section> <Body.Section> footer </Body.Section> </Body>;
Props
Also supports other valid props of the React Element. More about use props
<Body />
Prop name | Default value | Possible value | Description |
---|---|---|---|
body-background | null |
Create theme | Background color |
body-color | null |
Create theme | Text color |
body-display | block |
block none |
Display type |
body-indent | none |
none xxs xs s m l xl xxl 3xl 4xl 5xl |
Padding on the side left and right for children <Body.Section /> |
body-overflow * |
visible |
auto hidden scroll visible |
Overflow type |
body-overflow-anchor | auto |
auto none |
Scroll anchoring behavior |
body-width * |
null |
none xxs xs s m l xl xxl 3xl 4xl 5xl |
Min and Max width for children <Body.Section /> |
<Body.Section />
Prop name | Default value | Possible value | Description |
---|---|---|---|
body-section-display | block |
block none |
Display type |
body-section-height | auto |
auto inherit 1-1 |
Set the height |
Customize
This set of css variables is default, if you want to override one or more value, please use the rules css-variable-usage, define them below the css import.
@);@);@);@);@);
Live demo
body-display
block
- shown as blockynone
- remove from a document
<Body ='none'> ...</Body>
body-overflow
The property allows you to set the value for all axes at the same time or to determine it only for the specified axis
Advanced props
body-overflow-x
body-overflow-y
Multi values (set value separated by a space)
body-overflow="{1} {2}"
{1} - overflow-x, {2} - overflow-y
List of values
auto
- Scroll bars are added only when neededhidden
- Only the area inside the element is displayed, the rest will be hiddenscroll
- Scroll bars are always addedvisible
- The entire content of the element is displayed, even beyond the specified height and width
<Body ='scroll' /><Body ='visible scroll' /><Body ='visible' ='scroll' />
body-overflow-anchor
The property provides a way to opt out of the browser's scroll anchoring behavior, which adjusts scroll position to minimize content shifts.
Scroll anchoring behavior is enabled by default in any browser that supports it. Therefore, changing the value of this property is typically only required if you are experiencing problems with scroll anchoring in a document or part of a document and need to turn the behavior off. Read more
auto
- The element becomes a potential anchor when adjusting scroll position.none
- The element won't be selected as a potential anchor.
<Body ='none'> ...</Body>
body-indent
none
- no indent, value:0px
xxs
- css variable--ek-body-indent-xxs
, default value:5px
xs
- css variable--ek-body-indent-xs
, default value:10px
s
- css variable--ek-body-indent-s
, default value:15px
m
- css variable--ek-body-indent-m
, default value:20px
l
- css variable--ek-body-indent-l
, default value:25px
xl
- css variable--ek-body-indent-xl
, default value:30px
xxl
- css variable--ek-body-indent-xxl
, default value:35px
3xl
- css variable--ek-body-indent-3xl
, default value:40px
4xl
- css variable--ek-body-indent-4xl
, default value:45px
5xl
- css variable--ek-body-indent-5xl
, default value:50px
<Body ='m'> ...</Body>
body-width
This property set the min and max width for children <Body.Section />
Advanced props
body-width-min
body-width-max
Multi values (set value separated by a space)
body-width="{1} {2}"
{1} - width-min, {2} - width-max
List of values
none
- no min/max width, value:0/none
xxs
- css variable--ek-body-width-xxs
, default value:320px
xs
- css variable--ek-body-width-xs
, default value:480px
s
- css variable--ek-body-width-s
, default value:768px
m
- css variable--ek-body-width-m
, default value:900px
l
- css variable--ek-body-width-l
, default value:1024px
xl
- css variable--ek-body-width-xl
, default value:1280px
xxl
- css variable--ek-body-width-xxl
, default value:1366px
3xl
- css variable--ek-body-width-3xl
, default value:1440px
4xl
- css variable--ek-body-width-4xl
, default value:1600px
5xl
- css variable--ek-body-width-5xl
, default value:1920px
<Body ='l'> <Body.Section> // min-width: 1024px; max-width: 1024px; </Body.Section></Body> <Body ='xxs xl'> <Body.Section> // min-width: 320px; max-width: 1280px; </Body.Section></Body> <Body ='xxs' ='xl'> <Body.Section> // min-width: 320px; max-width: 1280px; </Body.Section></Body>
body-background
Set the
THEME_NAME
depending on the theming
<Body => ...</Body>
body-color
Set the
THEME_NAME
depending on the theming
<Body => ...</Body>
body-section-display
block
- shown as blockynone
- remove from a document
<Body> <Body.Section ='none'> ... </Body.Section></Body>
body-section-height
Set the height
auto
- value:auto
inherit
- value:inherit
1-1
- value:100%
<Body> <Body.Section ='1-1'> ... </Body.Section></Body>
body-size
!> DEPRECATED prop, please use body-width
xl
- css variable--ek-body-max-width-xl
, default value:1440px
xxl
- css variable--ek-body-max-width-xxl
, default value:1640px
xxxl
- css variable--ek-body-max-width-xxxl
, default value:1840px
<Body ='xl'> ...</Body>