/
githubmirror
/
styled-components
Обзор
Документация
Войти
/
githubmirror
/
styled-components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/benchmarks/src/implementations/inline-styles/Dot.js
34 строки
655 B
Evan Jacobs
chore: remove eslint
03 фев 2023, 19:37
03 фев 2023, 19:37
cffda28
Код
Авторство
О чём код?
import React from 'react'; const Dot = ({ size, x, y, children, color }) => ( <div style={{ ...styles.root, ...{ borderBottomColor: color, borderRightWidth: `${size / 2}px`, borderBottomWidth: `${size / 2}px`, borderLeftWidth: `${size / 2}px`, marginLeft: `${x}px`, marginTop: `${y}px`, }, }} > {children} </div> ); const styles = { root: { position: 'absolute', cursor: 'pointer', width: 0, height: 0, borderColor: 'transparent', borderStyle: 'solid', borderTopWidth: 0, transform: 'translate(50%, 50%)', }, }; export default Dot;