Incosistency of styling between development and production build
See original GitHub issueBug encountered:
I’m experiencing an inconsistent behavior regarding the styling of the form fields.
In my application I styled the standard components mat-input-flex mat-form-field-flex
class through ::ng-deep like so:
mat-form-field {
&.mat-form-field {
font-family: $body_font;
}
::ng-deep .mat-form-field-flex,
::ng-deep .mat-input-flex {
background-color: #f0f0ff !important;
padding: 0 12px !important;
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
}
and that works fine in my development environment.
When I do build the application for production (with Angular CLI through ng build --prod
) those styles don’t get applied anymore.
I’m not entirely sure if it’s an issue with material or with the cli.
What is the expected behavior?
The styles produced in development should match the ones in production.
Versions
Tested on Chrome 62 and Firefox Quantum 57
Angular CLI: 1.5.5
Node: 8.9.1
OS: linux x64
Angular: 5.0.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cdk: 5.0.0-rc0
@angular/cli: 1.5.5
@angular/material: 5.0.0-rc0
@angular-devkit/build-optimizer: 0.0.34
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.38
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.5
@schematics/angular: 0.1.8
typescript: 2.4.2
webpack: 3.8.1
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:17 (4 by maintainers)
Top Results From Across the Web
inconsistency in 'ng build' vs 'ng build --prod' - Stack Overflow
I am working on an angular app. Using. Angular 5.2.5; Angular CLI 1.6.8. When I executed command ng build. I did not ...
Read more >How does code style inconsistency affect pull request ...
In this paper, we performed an exploratory analysis on the effect of code style on PR inte- gration in GitHub. We modeled the...
Read more >Overview | Deploying to Production | Hilla Docs
The main difference between development and production modes is that, in the development mode, Hilla uses webpack to serve JavaScript files ...
Read more >Making Inconsistency Respectable in Software Development
Regardless, the classification of inconsistency management actions from the earlier work (Nuseibeh et al. 2001 ) is still useful for our ...
Read more >Reboot, Resets, and Reasoning - CSS-Tricks
... to build upon. If you're new to CSS development, the whole idea of a CSS reset is to deal with styling inconsistencies...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I can confirm that
ng build --prod --build-optimizer=false
works perfectly fine when you struggle to built your ng app with justng build --prod
1.7 has a new stylesheet optimization pipeline. You can try it in the current betas (latest is 1.7.0-beta.1).