File: truncate.scss

package info (click to toggle)
cockpit-machines 348-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 281,568 kB
  • sloc: javascript: 708,409; python: 14,549; cpp: 11,141; sh: 954; makefile: 159; xml: 88
file content (63 lines) | stat: -rw-r--r-- 1,228 bytes parent folder | download | duplicates (9)
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
@use '../../sass-utilities' as *;

@include pf-root($truncate) {
  --#{$truncate}--MinWidth: 6ch;
  --#{$truncate}__start--MinWidth: 6ch;
}

.#{$truncate} {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: baseline;
  min-width: var(--#{$truncate}--MinWidth);
  // stylelint-disable property-disallowed-list
  text-decoration: inherit; // enable inline link to have underline
  // stylelint-enable property-disallowed-list

  &.pf-m-fixed {
    display: inline;
    align-items: revert;
    min-width: revert;
  }
}

.#{$truncate}__start,
.#{$truncate}__end {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre;
}

.#{$truncate}__start {
  min-width: var(--#{$truncate}__start--MinWidth);
}

// End
.#{$truncate}__end {
  @include pf-v6-bidirectional-style (
    $prop: direction,
    $ltr-val: rtl,
    $rtl-val: ltr
  )
}

.#{$truncate}__start + .#{$truncate}__end {
  overflow: visible;

  @include pf-v6-bidirectional-style (
    $prop: direction,
    $ltr-val: ltr,
    $rtl-val: rtl
  )
}

// safari not supported
@supports (-webkit-hyphens: none) {
  .#{$truncate}__end {
    @include pf-v6-bidirectional-style (
      $prop: direction,
      $ltr-val: ltr,
      $rtl-val: rtl
    )
  }
}