summaryrefslogtreecommitdiff
path: root/app/assets/stylesheets/framework/tables.scss
blob: c6bc8fa0eac553bdc8987d2b1d22cd3321971e3a (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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
.table-holder {
  margin: 0;
  overflow: auto;
}

table {
  /*
  * TODO
  * This is a temporary workaround until we fix the neutral
  * color palette in https://gitlab.com/gitlab-org/gitlab/-/issues/213570
  *
  * The overwrites here affected the following areas:
  * - The security dashboard tables. When removing
  *   this code, table-th-transparent and original-text-color classes should
  *   be removed there.
  * - The subscription seats table. When removing this code, the .seats-table
  *   <th> and margin overrides should be removed there.
  *
  * Remove this code as soon as this happens
  *
  */
  &.gl-table {
    @include gl-text-gray-500;
  }

  .md &:not(.code),
  &.table {
    margin-bottom: $gl-padding;

    .dropdown-menu a {
      text-decoration: none;
    }

    .success,
    .warning,
    .danger,
    .info {
      color: $white;

      a:not(.btn) {
        text-decoration: underline;
        color: $white;
      }
    }

    tr {
      td,
      th {
        padding: 10px $gl-padding;
        line-height: 20px;
        vertical-align: middle;
      }

      th {
        @include gl-bg-gray-50;
        border-bottom: 0;

        &.wide {
          width: 55%;
        }

        &.table-th-transparent {
          background: none;
          color: $gl-text-color-secondary;
        }

        &.original-gl-th {
          @include gl-text-gray-500;
          border-bottom: 1px solid $cycle-analytics-light-gray;
        }
      }

    }

    .thead-white {
      th {
        background-color: $white;
        color: $gl-text-color-secondary;
        border-top: 0;
      }
    }
  }

  &.responsive-table {
    @include media-breakpoint-down(sm) {
      thead {
        display: none;
      }

      &,
      tbody,
      td {
        display: block;
      }

      td {
        color: $gl-text-color-secondary;
      }

      tbody td.responsive-table-cell {
        padding: $gl-padding 0;
        width: 100%;
        display: flex;
        text-align: right;
        align-items: center;
        justify-content: space-between;

        &[data-column]::before {
          content: attr(data-column);
          display: block;
          text-align: left;
          padding-right: $gl-padding;
          color: $gl-text-color-secondary;
        }

        &:not([data-column]) {
          flex-direction: row-reverse;
        }
      }

      tr.responsive-table-border-start,
      tr.responsive-table-border-end {
        display: block;
        border: solid $gl-text-color-quaternary;
        padding-left: 0;
        padding-right: 0;

        > td {
          border-color: $gl-text-color-quaternary;

          &,
          &:last-child {
            padding-left: $gl-padding;
            padding-right: $gl-padding;
          }
        }
      }

      tr.responsive-table-border-start {
        border-width: 1px 1px 0;
        border-radius: $border-radius-default $border-radius-default 0 0;
        padding-top: 0;
        padding-bottom: 0;

        > td:first-child {
          border-top: 0; // always have the <table> top border
        }

        > td:last-child {
          border-bottom: 1px solid $gl-text-color-quaternary;
        }
      }

      tr.responsive-table-border-end {
        border-width: 0 1px 1px;
        border-radius: 0 0 $border-radius-default $border-radius-default;
        margin-bottom: 2 * $gl-padding;

        > :last-child {
          border-bottom: 0;
        }
      }
    }
  }
}

.responsive-table:not(table) {
  @include media-breakpoint-down(sm) {
    th {
      width: 100%;
    }

    td {
      width: 100%;
      float: left;
    }
  }
}

.top-area + .content-list {
  th {
    border-top: 0;
  }
}