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

[Feature Request]: Ability to use dynamic styleUrls #20494

Open
sembo199 opened this issue Jan 4, 2023 · 0 comments
Open

[Feature Request]: Ability to use dynamic styleUrls #20494

sembo199 opened this issue Jan 4, 2023 · 0 comments

Comments

@sembo199
Copy link

sembo199 commented Jan 4, 2023

Is your feature request related to a problem? Please describe

For our Angular application we are using a dynamically set stylesheet URL based on an environment variable in our components. This gives us the ability to have multiple stylesheets with completely different styling in one codebase. This does not work for storybook. As soon as I try to do any operation storybook does not seem to find the stylesheet anymore. For instance, this works:
@Component({ selector: 'app-button', templateUrl: './button.component.html', styleUrls: ['./button.component.scss'] })
But this does not:
@Component({ selector: 'app-button', templateUrl: './button.component.html', styleUrls: ['./button.component.' + environment.scssExtension] })
This does not work either:
@Component({ selector: 'app-button', templateUrl: './button.component.html', styleUrls: ['./button.component.'+'scss'] })

It seems that any operation does not work when running storybook.

Describe the solution you'd like

I would like Storybook to work with dynamically set stylesheet URL's. This would mean we can use environment variables in our stylesheet URL's. When running storybook, we can set different environment variables to change the styling storybook uses.

Describe alternatives you've considered

No response

Are you able to assist to bring the feature to reality?

no

Additional context

No response

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