-
Notifications
You must be signed in to change notification settings - Fork 3
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
Angular production build - CSS mixins in component style NOT working properly with Polymer's custom-style #11
Comments
This is one of those issues developers hate: the dreaded missing semicolon. The "correct" way to write a CSS mixin is with a semicolon at the end: html {
--my-mixin: { display: none }; <--
--might-still-work-but-not-correct: { display: none }
} Angular's production build is minifying the CSS, which ShadyCSS parses at runtime. Unminified with a line break (dev mode), ShadyCSS can parse it. Minified without a line break (prod mode), it needs the semicolon. The following CSS from your example works for me when I cloned the repo: app.component.css html {
--app-word-wrapping: {
overflow-wrap: break-word;
word-wrap: break-word;
-ms-word-wrap: break-word;
word-break: break-word;
-ms-word-break: break-word;
}; <-- Note this worked without a semicolon because there are no rules following the "improper" mixin
}
.message-input-field {
--paper-input-container-input-color: var(--app-input-color);
--paper-input-container-underline: {
display: none;
};
--paper-input-container-underline-focus: {
display: none;
};
@apply --app-word-wrapping;
} |
To keep tracking the discussion of the issue: |
@hotforfeature Thanks for the update. Your last comment worked fine on my side. I mean the problem seemed fixed by simply replacing |
Glad the workaround fixed the problem. I'm not sure where the bug is, though my suspicion is to start looking at ShadyCSS because:
This is still on my radar, though I've got one other issue on Origami that I'm working through first since this has an easy workaround. I'll update this discussion if I find out more. |
@hotforfeature Thanks for quick response. Will expect the next update with the background of the issue. |
Reproduction
<paper-textarea>
element in an Angular componentCurrent output (on the browser's inspector)
Expected output on the inspector
This does happen only in the production build and everything works fine in the development mode. The production build is configured based on origami's production build guide and
enableProdMode()
is invoked in the production mode. (See also https://github.com/hotforfeature/origami/tree/master/demo for more detail of my production build configuration)Not sure if this problem comes from Angular production mode itself or anything else.
The text was updated successfully, but these errors were encountered: