Reputation: 451
I'm currently working with md-tab-group (just updated to latest version yesterday)...
Does anyone know
Thank you!
Upvotes: 45
Views: 77607
Reputation: 21
Revisando en modo "Desarrollador" desde el navegador Edge, encontré que puedes quitarle ese efecto mediante CSS o SASS utilizando las propiedades que se usan para "ripple":
.mat-mdc-icon-button
border-radius: 0px
--mat-icon-button-state-layer-color: transparent
--mat-icon-button-ripple-color: transparent
// Para el cursor:
.mdc-icon-button
cursor: default
Puedes ponerle "transparent" o "none".
Por favor califica esta respuesta si te sirvió.
Upvotes: 2
Reputation: 39
The current version of Angular I'm now working on is 15.2.6. This is the only way it worked for me when using components like MatStepper:
app.module.ts
import {MatRippleModule, MAT_RIPPLE_GLOBAL_OPTIONS } from '@angular/material/core';**
@NgModule
, you should provide this in the providers[]
array:
providers: [{provide: MAT_RIPPLE_GLOBAL_OPTIONS, useValue: {disabled: true}}]
Upvotes: 3
Reputation: 431
If you want to remove ripple and click effect in Angular v15 with Angular material v15 you can do it with the "disableRipple" property and some stylings.
<mat-checkbox
formControlName="yes"
disableRipple
>Yes
</mat-checkbox>
Add styling rule to the styles.scss or styles.css:
.mdc-checkbox__ripple {
display: none;
}
Upvotes: 1
Reputation: 104690
Use disableRipple as an attribute to disable ripples for the md-tab-group
as Angular2+ using the Angular material.
Just simply do something like this:
<md-tab-group disableRipple></md-tab-group>
Also if you are using the latest Angular Material, it's a little bit different like this below:
<mat-tab-group [disableRipple]="true"></mat-tab-group>
Upvotes: 93
Reputation: 35
I came up with two ways to override md styles based on another post. I had the exact same problem for tabs being too wide in a small tab group. It is still very experimental and might need further explanations but it has worked for me.
You can use /deep/ before the class you are trying to override
/* your-component.component.scss file*/
/deep/ .md-tab-label {
min-width: 0px; /* Or whatever value you wish */
/* In some situations !important seems necessary */
}
<!-- your-component.component.html -->
<!-- Template from Angular Material's Github Readme.md -->
<md-tab-group>
<md-tab>
<template md-tab-label>
The <em>best</em> pasta
</template>
<h1>Best pasta restaurants</h1>
<p>...</p>
</md-tab>
<md-tab>
<template md-tab-label>
<md-icon>thumb_down</md-icon> The worst sushi
</template>
<h1>Terrible sushi restaurants</h1>
<p>...</p>
</md-tab>
</md-tab-group>
Second solution with pure css
/* overrides.css */
.md-tab-label ,.md-tab-label-active {
min-width: 0; /* same comments as the first solution */
}
<!-- index.html -->
<link rel="stylesheet" content="text/css" href="overrides.css">
Both are kinda dirty, but the first one provides me a good solution to override a md component's style, keeping the alterations inside the concerned components (consider wrapping those components for local changes only).
Upvotes: 0