summaryrefslogtreecommitdiff
path: root/app/assets/stylesheets/bootstrap_migration_components.scss
blob: b6cecbe58067326ee5286bde41e2ef01a748590f (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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
// ---
// Scss to help with bootstrap 3 to 4 migration of bootstrap components
// ---
.form-control,
.search form {
  // Override default font size used in non-csslab UI
  // Use rem to keep default font-size at 14px on body so 1rem still
  // fits 8px grid, but also allow users to change browser font size
  font-size: 0.875rem;
}

/* Our adjustments to hx & .hx above add unnecessary margins to modal-title
   and page-title in modals, so we set them to 0 in order to have properly
   formatted modal headers. */
.modal-header {
  .modal-title,
  .page-title {
    margin-top: 0;
    margin-bottom: 0;
  }
}

input[type='file'] {
  // Bootstrap 4 file input height is taller by default
  // which makes them look ugly
  line-height: 1;
}

.form-group.row .col-form-label {
  // Bootstrap 4 aligns labels to the left
  // for horizontal forms
  @include media-breakpoint-up(md) {
    text-align: right;
  }
}

@each $breakpoint in map-keys($grid-breakpoints) {
  @include media-breakpoint-up($breakpoint) {
    $infix: breakpoint-infix($breakpoint, $grid-breakpoints);

    .d#{$infix}-table-header-group {
      display: table-header-group !important;
    }
  }
}

.text-secondary {
  // Override Bootstrap's light secondary color
  // We have to use !important because bootstrap has that set as well
  color: $gl-text-color-secondary !important;
}

.bg-success,
.bg-primary,
.bg-info,
.bg-danger,
.bg-warning {
  .card-header {
    color: $white;
  }
}

// Polyfill deprecated selectors

.hidden {
  display: none !important;
  visibility: hidden !important;
}

.hide {
  display: none;
}

.dropdown-toggle::after,
.dropright .dropdown-menu-toggle::after {
  // Remove bootstrap's dropdown caret
  display: none;
}

// Add to .label so that old system notes that are saved to the db
// will still receive the correct styling
.badge:not(.gl-badge),
.label {
  padding: 4px 5px;
  font-size: 12px;
  font-style: normal;
  font-weight: $gl-font-weight-normal;
  display: inline-block;

  &.badge-gray {
    background-color: $label-gray-bg;
    color: $gl-text-color;
    text-shadow: none;
  }

  &.badge-inverse {
    background-color: $label-inverse-bg;
  }
}

.divider {
  // copied rules from node_modules/bootstrap/scss/_dropdown.scss:116
  // this might be safe to just remove instead
  // most places that use divider add overrides to undo these things
  // there is also a probably-unintentional use in deprecated_dropdown_divider.scss
  // so we would end up with .gl-dropdown .dropdown-divider
  height: 0;
  margin: 4px 0;
  overflow: hidden;
  border-top: 1px solid $border-color;
}

.info-well {
  background: $gray-10;
  color: $gl-text-color;
  border: 1px solid $border-color;
  border-radius: 4px;
  margin-bottom: 16px;

  .well-segment {
    padding: 16px;

    &:not(:last-of-type) {
      border-bottom: 1px solid $well-inner-border;
    }

    p,
    ol,
    ul,
    .form-group {
      &:last-of-type {
        margin-bottom: 0;
      }
    }
  }

  .badge.badge-gray {
    background-color: $well-expand-item;
  }
}

.card {
  &.card-without-border,
  &.bg-light {
    border: 0 !important;
  }
}

.nav-tabs {
  // Override bootstrap's default border
  border-bottom: 0;

  .nav-link {
    border-top: 0;
    border-left: 0;
    border-right: 0;
  }

  .nav-item {
    margin-bottom: 0;
  }
}

.alert {
  border-radius: 0;
}

.alert-success {
  background-color: $green-500;
  border-color: $green-500;
}

.alert-info {
  background-color: $blue-500;
  border-color: $blue-500;
}

.alert-warning {
  background-color: $orange-500;
  border-color: $orange-500;
}

.alert-danger {
  background-color: $red-500;
  border-color: $red-500;
}

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

  h4,
  .alert-link {
    color: $white;
  }
}

input[type=color].form-control {
  height: $input-height;
}

.toggle-sidebar-button {
  .collapse-text,
  .icon-chevron-double-lg-left,
  .icon-chevron-double-lg-right {
    color: $gl-text-color-secondary;
  }
}

.project-templates-buttons {
  .btn {
    vertical-align: unset;
  }
}