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

fix(babel): support for dynamic keys in objects with css as values #714

Merged
merged 1 commit into from Dec 8, 2020

Conversation

Anber
Copy link
Collaborator

@Anber Anber commented Dec 7, 2020

Motivation

Support for syntax like that:

import { css } from '@linaria/core';
import { TestEnum } from './ts-data.ts';

export const object = {
	[TestEnum.FirstValue]: css``,
	[TestEnum.SecondValue]: css``,
}

Summary

For now, Linaria throws an error if meets a dynamic key. After this PR, Linaria will use normalized source code between [] as a display name for the generated class.

Test plan

New test was added.

@Anber Anber merged commit 17ee220 into master Dec 8, 2020
@Anber Anber deleted the dynamic-object-keys branch December 8, 2020 12:02
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

1 participant