Last change
on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | // This mixin will ensure that lines that overflow the container will hide the overflow and
|
---|
2 | // truncate neatly with an ellipsis.
|
---|
3 | @mixin truncate-line() {
|
---|
4 | white-space: nowrap;
|
---|
5 | overflow: hidden;
|
---|
6 | text-overflow: ellipsis;
|
---|
7 | }
|
---|
8 |
|
---|
9 | // Mixin to provide all mat-line styles, changing secondary font size based on whether the list
|
---|
10 | // is in dense mode.
|
---|
11 | @mixin base($secondary-font-size) {
|
---|
12 | .mat-line {
|
---|
13 | @include truncate-line();
|
---|
14 | display: block;
|
---|
15 | box-sizing: border-box;
|
---|
16 |
|
---|
17 | // all lines but the top line should have smaller text
|
---|
18 | &:nth-child(n+2) {
|
---|
19 | font-size: $secondary-font-size;
|
---|
20 | }
|
---|
21 | }
|
---|
22 | }
|
---|
23 |
|
---|
24 | // This mixin normalizes default element styles, e.g. font weight for heading text.
|
---|
25 | @mixin normalize-text() {
|
---|
26 | & > * {
|
---|
27 | margin: 0;
|
---|
28 | padding: 0;
|
---|
29 | font-weight: normal;
|
---|
30 | font-size: inherit;
|
---|
31 | }
|
---|
32 | }
|
---|
33 |
|
---|
34 | // This mixin provides base styles for the wrapper around mat-line elements in a list.
|
---|
35 | @mixin wrapper-base() {
|
---|
36 | @include normalize-text();
|
---|
37 |
|
---|
38 | display: flex;
|
---|
39 | flex-direction: column;
|
---|
40 | flex: auto;
|
---|
41 | box-sizing: border-box;
|
---|
42 | overflow: hidden;
|
---|
43 |
|
---|
44 | // Must remove wrapper when lines are empty or it takes up horizontal
|
---|
45 | // space and pushes other elements to the right.
|
---|
46 | &:empty {
|
---|
47 | display: none;
|
---|
48 | }
|
---|
49 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.