summaryrefslogtreecommitdiff
path: root/app/assets/stylesheets/framework/responsive-tables.scss
blob: 8e653c443cf19302c3cc3b936b9940198455f8b0 (plain)
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
@mixin flex-max-width($max) {
  flex: 0 0 #{$max + '%'};
  max-width: #{$max + '%'};
}

.gl-responsive-table-row {
  margin-top: 10px;
  border: 1px solid $border-color;

  @media (min-width: $screen-md-min) {
    padding: 15px 0;
    margin: 0;
    display: flex;
    align-items: center;
    border: none;
    border-bottom: 1px solid $white-normal;
  }

  .table-section {
    white-space: nowrap;

    $section-widths: 10 15 20 25 30 40;
    @each $width in $section-widths {
      &.section-#{$width} {
        flex: 0 0 #{$width + '%'};

        @media (min-width: $screen-md-min) {
          max-width: #{$width + '%'};
        }
      }
    }

    &:not(.table-button-footer) {
      @media (max-width: $screen-sm-max) {
        display: flex;
        align-self: stretch;
        padding: 10px;
        align-items: center;
        min-height: 62px;

        &:not(:first-of-type) {
          border-top: 1px solid $white-normal;
        }
      }
    }

    &.section-wrap {
      white-space: normal;

      @media (max-width: $screen-sm-max) {
        flex-wrap: wrap;
      }
    }
  }
}


.table-button-footer {
  @media (min-width: $screen-md-min) {
    text-align: right;
  }

  @media (max-width: $screen-sm-max) {
    background-color: $gray-normal;
    align-self: stretch;
    border-top: 1px solid $border-color;

    .table-action-buttons {
      padding: 10px 5px;
      display: flex;

      .btn {
        border-radius: 3px;
      }

      > .btn-group,
      > .external-url,
      > .btn {
        flex: 1 1 28px;
        margin: 0 5px;
      }

      .dropdown-new {
        width: 100%;
      }

      .dropdown-menu {
        min-width: initial;
      }
    }
  }
}

.table-row-header {
  font-size: 13px;

  @media (max-width: $screen-sm-max) {
    display: none;
  }
}

.table-mobile-header {
  @include flex-max-width(40);
  color: $gl-text-color-secondary;
  text-align: left;

  @media (min-width: $screen-md-min) {
    display: none;
  }
}

.table-mobile-content {
  @media (max-width: $screen-sm-max) {
    @include flex-max-width(60);
    text-align: right;
  }
}

.flex-truncate-parent {
  display: flex;
}

.flex-truncate-child {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  @media (min-width: $screen-md-min) {
    flex: 0 0 90%;
  }

  .avatar {
    float: none;
    margin-right: 4px;
  }
}