-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Add Instructions for overriding component styles through link tag in index.html #1273
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
@gopherkhan FYI, only a handful of the component currently have ViewEncapsulation turned on (tabs, progress, tooltip). What's likely getting in your way is the ViewEncapsulation in your own components. Here's an example of a component defining styles that affect other components by turning off ViewEncapsulation. At this point, we don't want to encourage overriding of any styles in Material; because we're still in alpha, our css classes and DOM structure will change. Once things are more stable, we plan on providing an API of classes that you're able to style. |
@jelbourn can you provide any feedback on this one? I am using
I want to override the 'bottom' and set color for all I could of use |
Yeah, it's a little hard to style the slider. If for example, you need to add a unit next to the label's value, the wrapper needs to be bigger, but in order to do so I've had to add global styles with .mat-slider-thumb-label {
opacity: 1;
right: -30px !important;
top: -55px !important;
width: 75px !important;
height: 30px !important;
border-radius: 10px !important;
background-color: teal !important;
transform: scale(1) rotate(0) !important;
&::after {
content: ' ';
width: 20px;
height: 20px;
position: absolute;
transform: rotate(45deg);
bottom: 0;
left: 28px;
background-color: teal;
}
}
.mat-slider-thumb-label-text {
transform: rotate(0deg) !important;
position: relative;
opacity: 1 !important;
left: -6px;
// TODO: find a better way to add square meters
&::after {
content: ' m²';
position: absolute;
width: auto;
height: auto;
white-space: pre;
color: white;
}
} Is there a better way to do this?? |
@Snesi not necessarily better, but you can remove your .mat-slider.mat-slider-thumb-label-showing
.mat-slider-thumb-container
.mat-slider-thumb-label {
opacity: 1;
right: -30px;
top: -55px;
width: 75px;
height: 30px;
border-radius: 10px;
background-color: teal;
transform: scale(1) rotate(0);
} |
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, feature request, or proposal:
Documentation Update:
Currently ViewEncapsulation in Material components makes things extremely hard to style without using
::shadow
or/deep/
combinators (both of which are currently being deprecated).We need to indicate to users that they can override component styles using a global CSS file, specified in the link tag of their index.html
Otherwise the components appear too rigid for actual use.
What is the expected behavior?
Documentation indicates easy way to customize styles for Materials components (e.g. link color on a card).
What is the current behavior?
No such documentation exists. Components appear excessively rigid/restrictive, as if you are locked in to specific styles, colors, etc.
What are the steps to reproduce?
Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: http://plnkr.co/edit/o077B6uEiiIgkC0S06dd
Is there anything else we should know?
Referred here by Martin.
The text was updated successfully, but these errors were encountered: