mirror of
https://github.com/zhigang1992/styled-components.git
synced 2026-04-28 09:24:31 +08:00
16 lines
441 B
JavaScript
16 lines
441 B
JavaScript
// @flow
|
|
import constructWithOptions from './constructWithOptions';
|
|
import StyledComponent from '../models/StyledComponent';
|
|
import domElements from '../utils/domElements';
|
|
|
|
import type { Target } from '../types';
|
|
|
|
const styled = (tag: Target) => constructWithOptions(StyledComponent, tag);
|
|
|
|
// Shorthands for all valid HTML Elements
|
|
domElements.forEach(domElement => {
|
|
styled[domElement] = styled(domElement);
|
|
});
|
|
|
|
export default styled;
|