-
Notifications
You must be signed in to change notification settings - Fork 2
Quick start
Евгений edited this page Jul 24, 2019
·
1 revision
Simple use, allows you to quickly use the block with the default settings
import React from 'react';
import { Text } from 'evokit-text';
import 'evokit-text/style.css';
const App = () => (
<Text text-align='center'>
Hello, world!
</Text>
);
Recommend using advanced mode. To do this, you will need to create a UI folder in the project where the configured blocks.
├── UI/
│ └── Text/
│ └───── index.js
│ └───── style.css
│ └───── vars.css
│ └── index.js
└── App.jsx
UI/Text/index.js
import { Text } from 'evokit-text';
import './style.css';
export { Text };
UI/Text/style.css
@import 'evokit-text/style.css';
@import './vars.css';
UI/Text/vars.css
:root {
--ek-text-line-height: 1.4em;
}
UI/index.js
import { Text } from './Text';
export { Text };
UI/App.jsx
import React from 'react';
import { Text } from './UI';
const App = () => (
<Text text-align='center'>
Hello, world!
</Text>
);
Consider the same files structure as Advanced mode.
UI/Text/index.js
import { withProps } from 'evokit';
import { Text as EKText } from 'evokit-text';
import style from './style.css';
export const Text = withProps(EKText, {
'text-preset': {
css: style,
},
});