Reputation: 14877
I have an issue with border-top-left-radius
and border-bottom-left-radius
on a button which seem to work in development build but not in production. When I run ng serve
I get the expected result:
If I just run the same project with ng serve --prod
I get this:
...with some errors in Developer Tools:
Apparently, the build system didn't do a good job. Something didn't work as the styles weren't deployed correctly. This is easily reproducible with both Angular 6 and 7.
ng new test-app
Add a button in app.component.html
<button class="btn btn-primary rounded-circle">TEST</button>
Add CSS to app.component.css
.rounded-circle { border-radius: 50px !important; border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
I also used Bootstrap but it is no necessary to reproduce this.
Is there something obvious that I am missing?
Upvotes: 0
Views: 624
Reputation: 3330
It's overriden by the class underneath it that's generated in prod mode.
Unchecking it in the dev console like I did in the image results in the correct style, but to actually achieve so try replacing your CSS class with this:
.rounded-circle { border-radius: 0px 50px 50px 0px !important }
Upvotes: 2
Reputation: 21
Try to use this command ng serve --prod --build-optimizer=false
. It might fix your issue.
Upvotes: 0