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 support for <link> elements in svelte components #426

Merged
merged 3 commits into from
Jun 3, 2018
Merged

Conversation

tivac
Copy link
Owner

@tivac tivac commented Jun 3, 2018

Instead of only supporting single file component <style>, this adds support for <link> tags that reference an external stylesheet. Part of the impetus behind this is making transitioning from the old-style import css from "./styles.css"; flow easier to transition away from. Before you'd need to copy the contents of the CSS file into the svelte component. Now the process is deleting some code from inside the <script> block and turning the import into a <link>.

It also makes referencing classes/values from component-level CSS possible, because modular-css already knows how to process a CSS file. It doesn't know anything about a svelte HTML file though & it'd be a ton of work to add support for that.

So now there's an easy transitional path from the old-style css-as-data model to the preprocessor world where most classes can be completely static!

@tivac tivac self-assigned this Jun 3, 2018
@tivac tivac merged commit 49f8f0a into master Jun 3, 2018
@tivac tivac deleted the svelte-links branch June 3, 2018 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant