-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
CSS seems like it could be smaller #140
Comments
Yes, it should be minified. Right now it's doing some very light transformation so that styles are scoped, but there's a lot more we could do. I'll close this issue in favour of #8 as that covers a few different things in addition to minification. The main thing here is that we'd need to add something like PostCSS to parse the CSS and manipulate it properly (and in a way that lets us generate sourcemaps, etc). |
Oh my bad, I skimmed that issue but missed the part about minifying. |
I realize this ticket is closed but my question seems a bit petty and off-topic for #8 - What's up with that whitespace at the beginning of the textContent for the inserted style element? Svelte looks like it is specifically adding this, and equal number of spaces as the length into the component .html that the styles started at. This kind of has me scratching my head! The only thing I can think of this possibly being for is somehow aligning the CSS with the source to make debugging easier, but it doesn't really seem to do that even because newlines are treated the same as other characters when deciding how many spaces to add. |
Oh wow, that's a good point @Conduitry. You're right about the purpose – it was done with sourcemaps in mind, though we don't yet have CSS sourcemaps – but there's no reason to ship it. Reopening this issue to deal with that. |
stop prepending CSS with spaces (fixes #140)
Currently the outputted CSS contains line breaks and new lines, could we minify this? Example:
Input:
Output:
The text was updated successfully, but these errors were encountered: