From ca25760d48a7b8091a32a29a66ad494d8d39879e Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Fri, 11 Nov 2022 16:21:54 +0100 Subject: [PATCH] feat: vendor special version of bootstrap 5 The vendored version contains ONLY the color rules. This makes it easy to create custom themes on top of the original bootstrap. Signed-off-by: Tilman Vatteroth --- global-styles/bootstrap-vendor/_reboot.scss | 486 -------------- global-styles/bootstrap-vendor/bootstrap.scss | 45 -- .../colors-only-bootstrap/_accordion.scss | 25 + .../colors-only-bootstrap/_alert.scss | 22 + .../colors-only-bootstrap/_badge.scss | 16 + .../colors-only-bootstrap/_breadcrumb.scss | 13 + .../colors-only-bootstrap/_buttons.scss | 67 ++ .../colors-only-bootstrap/_card.scss | 20 + .../colors-only-bootstrap/_carousel.scss | 58 ++ .../colors-only-bootstrap/_close.scss | 24 + .../colors-only-bootstrap/_dropdown.scss | 41 ++ .../colors-only-bootstrap/_forms.scss | 14 + .../colors-only-bootstrap/_helpers.scss | 8 + .../colors-only-bootstrap/_images.scss | 16 + .../colors-only-bootstrap/_list-group.scss | 44 ++ .../colors-only-bootstrap/_modal.scss | 33 + global-styles/colors-only-bootstrap/_nav.scss | 41 ++ .../colors-only-bootstrap/_navbar.scss | 47 ++ .../colors-only-bootstrap/_offcanvas.scss | 26 + .../colors-only-bootstrap/_pagination.scss | 25 + .../colors-only-bootstrap/_popover.scss | 17 + .../colors-only-bootstrap/_progress.scss | 14 + .../colors-only-bootstrap/_reboot.scss | 618 ++++++++++++++++++ .../colors-only-bootstrap/_root.scss | 48 ++ .../colors-only-bootstrap/_tables.scss | 36 + .../colors-only-bootstrap/_toasts.scss | 17 + .../colors-only-bootstrap/_tooltip.scss | 13 + .../colors-only-bootstrap/_type.scss | 9 + .../colors-only-bootstrap/bootstrap.scss | 51 ++ .../forms/_form-check.scss | 77 +++ .../forms/_form-control.scss | 67 ++ .../forms/_form-range.scss | 55 ++ .../forms/_form-select.scss | 40 ++ .../forms/_form-text.scss | 13 + .../forms/_input-group.scss | 16 + .../colors-only-bootstrap/forms/_labels.scss | 19 + .../forms/_validation.scss | 18 + .../helpers/_color-bg.scss | 16 + .../helpers/_colored-links.scss | 18 + global-styles/dark.scss | 2 +- 40 files changed, 1703 insertions(+), 532 deletions(-) delete mode 100644 global-styles/bootstrap-vendor/_reboot.scss delete mode 100644 global-styles/bootstrap-vendor/bootstrap.scss create mode 100644 global-styles/colors-only-bootstrap/_accordion.scss create mode 100644 global-styles/colors-only-bootstrap/_alert.scss create mode 100644 global-styles/colors-only-bootstrap/_badge.scss create mode 100644 global-styles/colors-only-bootstrap/_breadcrumb.scss create mode 100644 global-styles/colors-only-bootstrap/_buttons.scss create mode 100644 global-styles/colors-only-bootstrap/_card.scss create mode 100644 global-styles/colors-only-bootstrap/_carousel.scss create mode 100644 global-styles/colors-only-bootstrap/_close.scss create mode 100644 global-styles/colors-only-bootstrap/_dropdown.scss create mode 100644 global-styles/colors-only-bootstrap/_forms.scss create mode 100644 global-styles/colors-only-bootstrap/_helpers.scss create mode 100644 global-styles/colors-only-bootstrap/_images.scss create mode 100644 global-styles/colors-only-bootstrap/_list-group.scss create mode 100644 global-styles/colors-only-bootstrap/_modal.scss create mode 100644 global-styles/colors-only-bootstrap/_nav.scss create mode 100644 global-styles/colors-only-bootstrap/_navbar.scss create mode 100644 global-styles/colors-only-bootstrap/_offcanvas.scss create mode 100644 global-styles/colors-only-bootstrap/_pagination.scss create mode 100644 global-styles/colors-only-bootstrap/_popover.scss create mode 100644 global-styles/colors-only-bootstrap/_progress.scss create mode 100644 global-styles/colors-only-bootstrap/_reboot.scss create mode 100644 global-styles/colors-only-bootstrap/_root.scss create mode 100644 global-styles/colors-only-bootstrap/_tables.scss create mode 100644 global-styles/colors-only-bootstrap/_toasts.scss create mode 100644 global-styles/colors-only-bootstrap/_tooltip.scss create mode 100644 global-styles/colors-only-bootstrap/_type.scss create mode 100644 global-styles/colors-only-bootstrap/bootstrap.scss create mode 100644 global-styles/colors-only-bootstrap/forms/_form-check.scss create mode 100644 global-styles/colors-only-bootstrap/forms/_form-control.scss create mode 100644 global-styles/colors-only-bootstrap/forms/_form-range.scss create mode 100644 global-styles/colors-only-bootstrap/forms/_form-select.scss create mode 100644 global-styles/colors-only-bootstrap/forms/_form-text.scss create mode 100644 global-styles/colors-only-bootstrap/forms/_input-group.scss create mode 100644 global-styles/colors-only-bootstrap/forms/_labels.scss create mode 100644 global-styles/colors-only-bootstrap/forms/_validation.scss create mode 100644 global-styles/colors-only-bootstrap/helpers/_color-bg.scss create mode 100644 global-styles/colors-only-bootstrap/helpers/_colored-links.scss diff --git a/global-styles/bootstrap-vendor/_reboot.scss b/global-styles/bootstrap-vendor/_reboot.scss deleted file mode 100644 index d958f5e11..000000000 --- a/global-styles/bootstrap-vendor/_reboot.scss +++ /dev/null @@ -1,486 +0,0 @@ -/* - * SPDX-FileCopyrightText: Original: Nicolas Gallagher and Jonathan Neal, Modified by the HedgeDoc developers (see AUTHORS file) - * - * SPDX-License-Identifier: MIT - */ - -// stylelint-disable declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix - -// Reboot -// -// Normalization of HTML elements, manually forked from Normalize.css to remove -// styles targeting irrelevant browsers while applying new styles. -// -// Normalize is licensed MIT. https://github.com/necolas/normalize.css - - -// Document -// -// 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`. -// 2. Change the default font family in all browsers. -// 3. Correct the line height in all browsers. -// 4. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS. -// 5. Change the default tap highlight to be completely transparent in iOS. - -*, -*::before, -*::after { - box-sizing: border-box; // 1 -} - -html { - font-family: sans-serif; // 2 - line-height: 1.15; // 3 - -webkit-text-size-adjust: 100%; // 4 - -webkit-tap-highlight-color: rgba($black, 0); // 5 -} - -// Shim for "new" HTML5 structural elements to display correctly (IE10, older browsers) -// TODO: remove in v5 -// stylelint-disable-next-line selector-list-comma-newline-after -article, aside, figcaption, figure, footer, header, hgroup, main, nav, section { - display: block; -} - -// Body -// -// 1. Remove the margin in all browsers. -// 2. As a best practice, apply a default `background-color`. -// 3. Set an explicit initial text-align value so that we can later use -// the `inherit` value on things like `` elements. - -body { - margin: 0; // 1 - font-family: $font-family-base; - @include font-size($font-size-base); - font-weight: $font-weight-base; - line-height: $line-height-base; - color: $body-color; - text-align: left; // 3 - background-color: $body-bg; // 2 -} - -// Future-proof rule: in browsers that support :focus-visible, suppress the focus outline -// on elements that programmatically receive focus but wouldn't normally show a visible -// focus outline. In general, this would mean that the outline is only applied if the -// interaction that led to the element receiving programmatic focus was a keyboard interaction, -// or the browser has somehow determined that the user is primarily a keyboard user and/or -// wants focus outlines to always be presented. -// -// See https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible -// and https://developer.paciellogroup.com/blog/2018/03/focus-visible-and-backwards-compatibility/ -[tabindex="-1"]:focus:not(:focus-visible) { - outline: 0 !important; -} - - -// Content grouping -// -// 1. Add the correct box sizing in Firefox. -// 2. Show the overflow in Edge and IE. - -hr { - box-sizing: content-box; // 1 - height: 0; // 1 - overflow: visible; // 2 -} - - -// -// Typography -// - -// Remove top margins from headings -// -// By default, `

`-`

` all receive top and bottom margins. We nuke the top -// margin for easier control within type scales as it avoids margin collapsing. -// stylelint-disable-next-line selector-list-comma-newline-after -h1, h2, h3, h4, h5, h6 { - margin-top: 0; - margin-bottom: $headings-margin-bottom; -} - -// Reset margins on paragraphs -// -// Similarly, the top margin on `

`s get reset. However, we also reset the -// bottom margin to use `rem` units instead of `em`. -p { - margin-top: 0; - margin-bottom: $paragraph-margin-bottom; -} - -// Abbreviations -// -// 1. Duplicate behavior to the data-* attribute for our tooltip plugin -// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. -// 3. Add explicit cursor to indicate changed behavior. -// 4. Remove the bottom border in Firefox 39-. -// 5. Prevent the text-decoration to be skipped. - -abbr[title], -abbr[data-original-title] { // 1 - text-decoration: underline; // 2 - text-decoration: underline dotted; // 2 - cursor: help; // 3 - border-bottom: 0; // 4 - text-decoration-skip-ink: none; // 5 -} - -address { - margin-bottom: 1rem; - font-style: normal; - line-height: inherit; -} - -ol, -ul, -dl { - margin-top: 0; - margin-bottom: 1rem; -} - -ol ol, -ul ul, -ol ul, -ul ol { - margin-bottom: 0; -} - -dt { - font-weight: $dt-font-weight; -} - -dd { - margin-bottom: .5rem; - margin-left: 0; // Undo browser default -} - -blockquote { - margin: 0 0 1rem; -} - -b, -strong { - font-weight: $font-weight-bolder; // Add the correct font weight in Chrome, Edge, and Safari -} - -small { - @include font-size(80%); // Add the correct font size in all browsers -} - -// -// Prevent `sub` and `sup` elements from affecting the line height in -// all browsers. -// - -sub, -sup { - position: relative; - @include font-size(75%); - line-height: 0; - vertical-align: baseline; -} - -sub { bottom: -.25em; } -sup { top: -.5em; } - - -// -// Links -// - -a { - color: $link-color; - text-decoration: $link-decoration; - background-color: transparent; // Remove the gray background on active links in IE 10. - - @include hover() { - color: $link-hover-color; - text-decoration: $link-hover-decoration; - } -} - -// And undo these styles for placeholder links/named anchors (without href). -// It would be more straightforward to just use a[href] in previous block, but that -// causes specificity issues in many other styles that are too complex to fix. -// See https://github.com/twbs/bootstrap/issues/19402 - -a:not([href]):not([class]) { - color: inherit; - text-decoration: none; - - @include hover() { - color: inherit; - text-decoration: none; - } -} - - -// -// Code -// - -pre, -code, -kbd, -samp { - font-family: $font-family-monospace; - @include font-size(1em); // Correct the odd `em` font sizing in all browsers. -} - -pre { - // Remove browser default top margin - margin-top: 0; - // Reset browser default of `1em` to use `rem`s - margin-bottom: 1rem; - // Don't allow content to break outside - overflow: auto; - // Disable auto-hiding scrollbar in IE & legacy Edge to avoid overlap, - // making it impossible to interact with the content - -ms-overflow-style: scrollbar; -} - - -// -// Figures -// - -figure { - // Apply a consistent margin strategy (matches our type styles). - margin: 0 0 1rem; -} - - -// -// Images and content -// - -img { - vertical-align: middle; - border-style: none; // Remove the border on images inside links in IE 10-. -} - -svg { - // Workaround for the SVG overflow bug in IE10/11 is still required. - // See https://github.com/twbs/bootstrap/issues/26878 - overflow: hidden; - vertical-align: middle; -} - - -// -// Tables -// - -table { - border-collapse: collapse; // Prevent double borders -} - -caption { - padding-top: $table-cell-padding; - padding-bottom: $table-cell-padding; - color: $table-caption-color; - text-align: left; - caption-side: bottom; -} - -// 1. Removes font-weight bold by inheriting -// 2. Matches default `` alignment by inheriting `text-align`. -// 3. Fix alignment for Safari - -th { - font-weight: $table-th-font-weight; // 1 - text-align: inherit; // 2 - text-align: -webkit-match-parent; // 3 -} - - -// -// Forms -// - -label { - // Allow labels to use `margin` for spacing. - display: inline-block; - margin-bottom: $label-margin-bottom; -} - -// Remove the default `border-radius` that macOS Chrome adds. -// -// Details at https://github.com/twbs/bootstrap/issues/24093 -button { - // stylelint-disable-next-line property-disallowed-list - border-radius: 0; -} - -// Explicitly remove focus outline in Chromium when it shouldn't be -// visible (e.g. as result of mouse click or touch tap). It already -// should be doing this automatically, but seems to currently be -// confused and applies its very visible two-tone outline anyway. - -button:focus:not(:focus-visible) { - outline: 0; -} - -input, -button, -select, -optgroup, -textarea { - margin: 0; // Remove the margin in Firefox and Safari - font-family: inherit; - @include font-size(inherit); - line-height: inherit; -} - -button, -input { - overflow: visible; // Show the overflow in Edge -} - -button, -select { - text-transform: none; // Remove the inheritance of text transform in Firefox -} - -// Set the cursor for non-`