-
Notifications
You must be signed in to change notification settings - Fork 12k
Compile inline styles to the identified style format (SCSS, LESS, etc) #8470
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
Comments
Hi @johnpapa, Inline styles will not be rendered with a special renderer, unfortunately. It is impossible for us to know which compiler you want your inline style to use, and even so we don't have control over how inline styles are compiled; we do not resolve their content like we do with external styles. This is a limitation of the angular compiler itself. I'm going to close this as working as intended. Cheers! |
I do not understand ... if the CLI knows it is SASS (aka scss), then how do we not know what to tell the compiler? How are external file templates different? Is it because SASS just hits those extensions by default and the webpack compiler for sass, less, etc are always there? |
FYI there was a PR to do this (#8145). |
We do by the file extension. For inline styles we don't. The PR referred by Filipe is a hack that creates fake files and refactor the component. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
Angular CLI: 1.5.0
Node: 8.9.1
OS: darwin x64
macOS Sierra 10.12.6
Repro steps.
ng new foo --styles scss
ng serve -o
The log given by the failure.
The style compile as CSS, even though we set them to be SCSS in the cli json file
Desired functionality.
I would like to see angular transpile inline styles and external files styles using the identified selection.
Mention any other details that might be useful.
The workaround is to move styles for SCSS to their own file, using the
styleUrls
metadata.The text was updated successfully, but these errors were encountered: