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

[enhancement - babel plugin] Respect custom options in styled calls #582

Closed
Andarist opened this issue Mar 2, 2018 · 0 comments · Fixed by #584
Closed

[enhancement - babel plugin] Respect custom options in styled calls #582

Andarist opened this issue Mar 2, 2018 · 0 comments · Fixed by #584

Comments

@Andarist
Copy link
Member

Andarist commented Mar 2, 2018

babel options

module.exports = {
	plugins: [
		['emotion', { autoLabel: process.env.NODE_ENV === 'development' }],
	]
}

input

const StyledBar = styled(Row, { test: true })`
	padding: 1em;
`

actual

const StyledBar = styled(Row, {
	label: 'StyledBar',
	target: 'e1j58gbc0'
})`
	padding: 1em;
`

expected

const StyledBar = styled(Row, {
	test: true,
	label: 'StyledBar',
	target: 'e1j58gbc0'
})`
	padding: 1em;
`

Use case
Custom emotion wrappers, I want to put some styling logic into a centralized, single piece of code - my own version of styled that I'm going to use across my entire app. It will be only a thin wrapper around standard emotion, so ideally I'd like to use existing babel plugin.

Implementation
I'm ofc willing to work on this, would like to get approval from you first though before I start to work on this.

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 a pull request may close this issue.

1 participant