File: item-layout.less

package info (click to toggle)
icinga-php-library 0.17.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,148 kB
  • sloc: php: 49,799; javascript: 9,301; makefile: 6
file content (160 lines) | stat: -rw-r--r-- 2,947 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// Layout

.item-layout {
  // Note that mode specific rules are as strict as possible to avoid conflicts with nested layouts.
  // Consider an item which contains another item in a different layout mode. Coincidentally, this is
  // already the case in Icinga DB Web with the last comment flyout.

  .flowing-content(@layout) when (@layout = "default") {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
    min-width: 0;
    column-gap: .28125em; // calculated   width

    > .ellipsize, > .subject { // .subject is compat only, Icinga DB Web used it thoroughly
      .text-ellipsis();
    }
  }
  .flowing-content(@layout) when (@layout = "detailed") {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: .28125em; // calculated   width
  }

  display: flex;

  .visual {
    display: flex;
    flex-direction: column;

    width: auto;
    padding: .25em 0;
    margin-right: 1em;

    > i.icon {
      font-size: 1.5em;

      &::before {
        margin-right: 0;
      }
    }
  }

  .main {
    flex: 1 1 auto;
    padding: .25em 0;
    width: 0;
  }

  header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
  }
  &.minimal-item-layout > .main > header {
    max-width: 100%;
  }

  .caption {
    p {
      display: inline-block;
    }

    img {
      max-height: 1em;
    }
  }
  &.default-item-layout > .main > .caption {
    height: 1.5em;

    .text-ellipsis();
  }
  &.minimal-item-layout > .main > header > .caption {
    flex: 1 1 auto;
    height: 1.5em;
    width: 0;

    &:not(:empty) {
      margin-right: 1em;
    }

    .text-ellipsis();
  }
  &.detailed-item-layout > .main > .caption {
    display: block;
    overflow: hidden;
    position: relative;

    .line-clamp(5);
  }

  footer {
    display: flex;
    justify-content: space-between;

    padding-top: .5em;
  }

  .title {
    margin-right: 1em;
  }
  &.default-item-layout > .main > header > .title {
    .flowing-content("default");
  }
  &.detailed-item-layout > .main > header > .title {
    .flowing-content("detailed");

    word-break: break-word;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
  }

  header > .extended-info {
    flex-shrink: 0;
  }
  &.default-item-layout > .main > header > .extended-info {
    .flowing-content("default");
  }
  &.detailed-item-layout > .main > header > .extended-info {
    .flowing-content("detailed");
  }
}

// Style

.item-layout {
  color: @default-text-color-light;

  .caption {
    i {
      opacity: 0.8;
    }

    a {
      color: @default-text-color;
    }
  }

  .title {
    .subject {
      color: @default-text-color;
    }

    a {
      color: @default-text-color;
      font-weight: bold;

      &:hover {
        color: @link-hover-color;
        text-decoration: none;

        .subject {
          color: @link-hover-color;
        }
      }
    }
  }
}