I really would like SEARCH to become Search and CLEAR ALL to become Clear All
This CSS doesn’t work (grabbed it from CSS text-transform capitalize on all caps).
.common-search-footer {
display: flex;
background: #ededed;
font-size: small;
color: rgba(0, 0, 0, 0.87);
justify-content: flex-end;
width: 100%;
text-transform: lowercase;
}
.common-search-footer,
.common-search-footer:first-line {
text-transform: uppercase;
}
<mat-card-footer class="common-search-footer">
<button mat-button type="submit" id="searchButton">
<i class="fa fa-search" aria-hidden="true"></i> SEARCH</button>
<button mat-button class="red" type="button" id="clearButton">
<i class="fa fa-times"></i> CLEAR ALL</button>
</mat-card-footer>
2
Answers
You’ll need to set the
text-transform
to the<button>
itself:Note that due to
:first-line
, this will only work if you content does not exceeds a single line.Since
capitalize
does not work on upper cased text, we first applytext-transform: lowercase
to ensures welowercase
the text. Then we overwrite it withtext-transform: capitalize
on the:first-line
.Use this CSS