debian-mirror-gitlab/app/assets/stylesheets/bootstrap_migration.scss

319 lines
5.4 KiB
SCSS
Raw Normal View History

2018-11-08 19:23:39 +05:30
$text-color: $gl-text-color;
2018-11-20 20:47:30 +05:30
$brand-primary: $blue-500;
$brand-success: $green-500;
$brand-info: $blue-500;
$brand-warning: $orange-500;
$brand-danger: $red-500;
2018-11-08 19:23:39 +05:30
2020-07-28 23:09:34 +05:30
$border-radius-base: $gl-border-radius-base;
2018-11-08 19:23:39 +05:30
2020-04-22 19:07:51 +05:30
$modal-body-bg: $white;
2018-11-08 19:23:39 +05:30
$input-border: $border-color;
$padding-base-vertical: $gl-vert-padding;
$padding-base-horizontal: $gl-padding;
2019-09-30 21:07:59 +05:30
/*
* Scss to help with bootstrap 3 to 4 migration
*/
2019-02-15 15:39:39 +05:30
body,
.form-control,
.search form {
// Override default font size used in non-csslab UI
2019-09-04 21:01:54 +05:30
// 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
2020-07-28 23:09:34 +05:30
font-size: 0.875rem;
2018-11-08 19:23:39 +05:30
}
legend {
border-bottom: 1px solid $border-color;
margin-bottom: 20px;
}
button,
2020-07-28 23:09:34 +05:30
html [type='button'],
[type='reset'],
[type='submit'],
[role='button'] {
2018-11-08 19:23:39 +05:30
// Override bootstrap reboot
2020-07-28 23:09:34 +05:30
/* stylelint-disable-next-line property-no-vendor-prefix */
2018-11-08 19:23:39 +05:30
-webkit-appearance: inherit;
cursor: pointer;
}
h1,
.h1,
h2,
.h2,
h3,
.h3 {
margin-top: 20px;
margin-bottom: 10px;
}
h4,
.h4,
h5,
.h5,
h6,
.h6 {
margin-top: 10px;
margin-bottom: 10px;
}
2019-02-15 15:39:39 +05:30
/* 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;
}
}
2018-11-08 19:23:39 +05:30
h5,
.h5 {
font-size: $gl-font-size;
}
2020-07-28 23:09:34 +05:30
input[type='file'] {
2018-11-08 19:23:39 +05:30
// Bootstrap 4 file input height is taller by default
// which makes them look ugly
line-height: 1;
}
b,
strong {
font-weight: bold;
}
a {
2018-11-20 20:47:30 +05:30
color: $blue-600;
2018-11-08 19:23:39 +05:30
}
hr {
overflow: hidden;
}
.form-group.row .col-form-label {
// Bootstrap 4 aligns labels to the left
// for horizontal forms
@include media-breakpoint-up(md) {
text-align: right;
}
}
code {
padding: 2px 4px;
2020-04-08 14:13:33 +05:30
color: $code-color;
2020-06-23 00:09:42 +05:30
background-color: $gray-50;
2018-11-18 11:00:15 +05:30
border-radius: $border-radius-default;
2018-11-08 19:23:39 +05:30
2021-01-29 00:20:46 +05:30
.code > &,
2021-11-18 22:05:49 +05:30
.build-log & {
2018-11-08 19:23:39 +05:30
background-color: inherit;
2021-01-29 00:20:46 +05:30
padding: unset;
2018-11-08 19:23:39 +05:30
}
}
table {
// Remove any table border lines
border-spacing: 0;
}
@each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
2019-02-15 15:39:39 +05:30
.d#{$infix}-table-header-group {
display: table-header-group !important;
}
2018-11-08 19:23:39 +05:30
}
}
.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 {
2020-04-22 19:07:51 +05:30
color: $white;
2018-11-08 19:23:39 +05:30
}
}
// 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
2020-06-23 00:09:42 +05:30
.badge:not(.gl-badge),
2018-11-08 19:23:39 +05:30
.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 {
2021-04-17 20:07:23 +05:30
// 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;
2018-11-08 19:23:39 +05:30
}
.info-well {
2020-05-24 23:13:21 +05:30
background: $gray-10;
2018-11-08 19:23:39 +05:30
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 {
2021-04-17 20:07:23 +05:30
&.card-without-border,
2018-11-08 19:23:39 +05:30
&.bg-light {
2021-04-17 20:07:23 +05:30
border: 0 !important;
2018-11-08 19:23:39 +05:30
}
}
.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;
}
}
pre code {
white-space: pre-wrap;
}
2019-12-26 22:10:19 +05:30
.alert {
2018-11-08 19:23:39 +05:30
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,
2019-12-26 22:10:19 +05:30
.alert-danger {
2020-04-22 19:07:51 +05:30
color: $white;
2018-11-08 19:23:39 +05:30
h4,
.alert-link {
2020-04-22 19:07:51 +05:30
color: $white;
2018-11-08 19:23:39 +05:30
}
}
input[type=color].form-control {
height: $input-height;
}
.toggle-sidebar-button {
.collapse-text,
2020-07-28 23:09:34 +05:30
.icon-chevron-double-lg-left,
.icon-chevron-double-lg-right {
2018-11-08 19:23:39 +05:30
color: $gl-text-color-secondary;
}
}
.project-templates-buttons {
.btn {
vertical-align: unset;
}
}
2018-11-18 11:00:15 +05:30
2019-02-15 15:39:39 +05:30
/*
Bootstrap 4.1.2 introduced a new default vertical alignment which breaks our icons,
so we need to reset the vertical alignment to the default value. See:
2019-12-04 20:38:33 +05:30
- https://gitlab.com/gitlab-org/gitlab-foss/issues/51362
2019-02-15 15:39:39 +05:30
*/
svg {
vertical-align: baseline;
}