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

add a test for nested styles #639

Merged
merged 1 commit into from
Aug 16, 2022
Merged

add a test for nested styles #639

merged 1 commit into from
Aug 16, 2022

Conversation

steve8708
Copy link
Contributor

@steve8708 steve8708 commented Aug 16, 2022

we should probably doc that all of this is possible with css={{}} if we haven't

e.g. this

   <div
      css={{
        display: 'flex',
        foo: 'var(--bar)',
        '@media (max-width: env(--mobile))': {
          display: 'block',
        },
        '&:hover': {
          display: 'flex',
        },
        '.nested-selector': {
          display: 'grid',
        },
      }}
    >
      Hello world
    </div>

becomes:

 .div {
    display: flex;
    foo: var(--bar);
  }
  @media (max-width: env(--mobile)) {
    .div {
      display: block;
    }
  }
  .div:hover {
    display: flex;
  }
  .div .nested-selector {
    display: grid;
  }

we should probably doc that all of this is possible with css={{}} if we haven't

```jsx
<div
      css={{
        display: 'flex',
        foo: 'var(--bar)',
        '@media (max-width: env(--mobile))': {
          display: 'block',
        },
        '&:hover': {
          display: 'flex',
        },
        '.nested-selector': {
          display: 'grid',
        },
      }}
    >
      Hello world
    </div>
```
@steve8708 steve8708 requested review from a team and samijaber as code owners August 16, 2022 19:03
@vercel
Copy link

vercel bot commented Aug 16, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
mitosis-fiddle ✅ Ready (Inspect) Visit Preview Aug 16, 2022 at 7:06PM (UTC)

Copy link
Contributor

@samijaber samijaber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to also see this new test component in an e2e test to check that the nested styles actually do work as expected in every framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants