Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a @styled-system/styled wrapper #1846

Open
JakeElder opened this issue Feb 26, 2021 · 0 comments
Open

Create a @styled-system/styled wrapper #1846

JakeElder opened this issue Feb 26, 2021 · 0 comments

Comments

@JakeElder
Copy link

JakeElder commented Feb 26, 2021

It would be useful if we could wrap our styled implementation of choice so that it wasn't necessary to use @styled-system/css to resolve styled-system values.

IE, instead of

import styled from '@emotion/styled';
import css from '@styled-system/css';

const Heading = styled("h1")(css({ color: 'brand.1' }));

we could write

import styled from '@styled-system/styled';
const Heading = styled("h1")({ color: 'brand.1' });

or, ideally,

import styled from '@styled-system/styled';
const Heading = styled.h1`color: brand.1`

Presumably this would require some initial setup to in order to be able to support styled-components and @emotion/styled

// your-apps-entry-point.js
import { setStyledImplementation } from '@styled-system/styled';
import styled from '@emotion/styled';
setStyledImplementation(styled);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant