I've got a pretty satisfactory use of material2's buttons in my Angular 5 project.
I'm having trouble with styling a button which is meant to be with 90° rotated text.
to do things cleanly I'm rotating the inner div containing the text rather than the whole outer one.
My issue is that the hover and ripple of material2's buttons rather take the original text's width than that of the outer button div.
I'm fine with having to "hack" it into submission, I've already done this for the text but I can't manage to select or influence mat-button-focus-overlay or mat-button-ripple.
plus this starts to get more hacky if I want that button on the right-side screen edge :
am I approaching this the wrong way?
html :
<button class="my-button with-round-borders" mat-button>
<div class="inner-text">
Valider
</div>
</button>
<button class="curvy-button-left absolute-postition" mat-button>
<div class="inner-text rotate-left rectify-inner-text">
Filtres
</div>
</button>
css :
.my-button{
margin: 2px 0 0 18px;
width: 160px;
line-height: 38px;
border: 1px solid $transparent;
background-color: $col;
color: white;
&:focus{
outline: none;
}
}
.absolute-postition{
position: absolute;
top: 70px;
height: 160px;
}
.rectify-inner-text{
margin-left: -61px;
}
.inner-text{
@extend %ellipsis;
color: white;
}
.with-round-borders{
border-radius: 50px;
}
.rotate-left {
display:inline-block;
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
-webkit-transform: rotate(270deg);
-ms-transform: rotate(270deg);
transform: rotate(270deg);
}
.curvy-button-left{
background-image:
radial-gradient(circle at bottom right,transparent 50%, $col 55%),
radial-gradient(circle at bottom left,$col 50%,transparent 55%),
radial-gradient(circle at top left,$col 50%,transparent 55%),
radial-gradient(circle at top right,transparent 50%,$col 55%),
linear-gradient($col,$col),
linear-gradient($col,$col);
background-position:0 150px,20px 10px,20px 140px,0 0,0px 10px,20px 20px;
background-size:16px 10px,16px 10px,16px 10px,16px 10px,20px 140px,10px 120px;
background-repeat:no-repeat;
}




overflow: hiddenon.mat-button. This is also whyoverflow: hiddenworks, the same as<mat-button>