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

Update migration-from-styled-components.mdx #272

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ If you use dynamic mixins in your styled components, you need to change it the s

```tsx title="component.tsx"
import styled, { css } from 'styled-components'; // [!code --]
import { styled } from 'next-yak'; // [!code ++]
import { css, styled } from 'next-yak'; // [!code ++]

const mixin = css<{ $primary: boolean }>`
color: green;
Expand All @@ -276,7 +276,7 @@ Dynamic mixins work differently in next-yak than in styled-components. With next
As we transform the styles on a per-file basis, we can't share dynamic values between files. If you need to use a dynamic mixin in multiple components, you unfortunately need to duplicate the mixin in each file or move the components to the same file.
```tsx title="component.tsx"
import styled from 'styled-components'; // [!code --]
import { styled } from 'next-yak'; // [!code ++]
import { css, styled } from 'next-yak'; // [!code ++]

import { mixin } from './mixin'; // [!code --]
const mixin = css<{ $primary: boolean }>` // [!code ++]
Expand Down
Loading