From ba9124ce0fdb81c5612567fa308c28853417cc37 Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 3 Mar 2025 23:18:05 +1100 Subject: [PATCH] Update ArchitectUI to v4 --- resources/themes/architect/src/app.js | 1 - resources/themes/architect/src/base.scss | 9 +- .../src/components/bootstrap5/_alert.scss | 39 +- .../src/components/bootstrap5/_badge.scss | 19 +- .../components/bootstrap5/_breadcrumb.scss | 32 +- .../components/bootstrap5/_button-group.scss | 9 +- .../src/components/bootstrap5/_buttons.scss | 160 +++- .../src/components/bootstrap5/_card.scss | 98 ++- .../src/components/bootstrap5/_close.scss | 45 +- .../components/bootstrap5/_containers.scss | 2 +- .../components/bootstrap5/_custom-forms.scss | 507 ----------- .../src/components/bootstrap5/_dropdown.scss | 162 ++-- .../src/components/bootstrap5/_functions.scss | 75 +- .../src/components/bootstrap5/_grid.scss | 17 + .../src/components/bootstrap5/_helpers.scss | 5 + .../components/bootstrap5/_input-group.scss | 193 ----- .../components/bootstrap5/_list-group.scss | 97 ++- .../src/components/bootstrap5/_maps.scss | 174 ++++ .../src/components/bootstrap5/_mixins.scss | 6 +- .../src/components/bootstrap5/_modal.scss | 122 +-- .../src/components/bootstrap5/_nav.scss | 114 ++- .../src/components/bootstrap5/_navbar.scss | 233 +++--- .../components/bootstrap5/_pagination.scss | 87 +- .../src/components/bootstrap5/_print.scss | 141 ---- .../src/components/bootstrap5/_reboot.scss | 80 +- .../src/components/bootstrap5/_root.scss | 187 ++++- .../src/components/bootstrap5/_tables.scss | 70 +- .../src/components/bootstrap5/_tooltip.scss | 116 +-- .../components/bootstrap5/_transitions.scss | 6 + .../src/components/bootstrap5/_type.scss | 2 + .../src/components/bootstrap5/_utilities.scss | 294 ++++++- .../bootstrap5/_variables-dark.scss | 87 ++ .../src/components/bootstrap5/_variables.scss | 789 ++++++++++++------ .../components/bootstrap5/bootstrap-grid.scss | 11 +- .../bootstrap5/bootstrap-reboot.scss | 15 +- .../bootstrap5/bootstrap-utilities.scss | 13 +- .../src/components/bootstrap5/bootstrap.scss | 12 +- .../bootstrap5/forms/_floating-labels.scss | 42 +- .../bootstrap5/forms/_form-check.scss | 63 +- .../bootstrap5/forms/_form-control.scss | 79 +- .../bootstrap5/forms/_form-range.scss | 6 +- .../bootstrap5/forms/_form-select.scss | 18 +- .../bootstrap5/forms/_input-group.scss | 29 +- .../bootstrap5/helpers/_color-bg.scss | 7 + .../bootstrap5/helpers/_colored-links.scss | 22 +- .../bootstrap5/helpers/_focus-ring.scss | 5 + .../bootstrap5/helpers/_icon-link.scss | 25 + .../bootstrap5/helpers/_position.scss | 8 +- .../components/bootstrap5/helpers/_ratio.scss | 4 +- .../bootstrap5/helpers/_stacks.scss | 15 + .../components/bootstrap5/helpers/_vr.scss | 8 + .../components/bootstrap5/mixins/_alert.scss | 15 +- .../bootstrap5/mixins/_backdrop.scss | 14 + .../mixins/_background-variant.scss | 21 - .../components/bootstrap5/mixins/_badge.scss | 11 - .../components/bootstrap5/mixins/_banner.scss | 7 + .../bootstrap5/mixins/_breakpoints.scss | 16 +- .../bootstrap5/mixins/_buttons.scss | 127 +-- .../components/bootstrap5/mixins/_caret.scss | 55 +- .../bootstrap5/mixins/_color-mode.scss | 21 + .../bootstrap5/mixins/_container.scss | 6 +- .../bootstrap5/mixins/_deprecate.scss | 10 + .../components/bootstrap5/mixins/_float.scss | 11 - .../components/bootstrap5/mixins/_forms.scss | 43 +- .../bootstrap5/mixins/_gradients.scss | 2 +- .../bootstrap5/mixins/_grid-framework.scss | 66 -- .../components/bootstrap5/mixins/_grid.scss | 59 +- .../components/bootstrap5/mixins/_hover.scss | 37 - .../bootstrap5/mixins/_list-group.scss | 2 + .../bootstrap5/mixins/_nav-divider.scss | 10 - .../bootstrap5/mixins/_pagination.scss | 29 +- .../bootstrap5/mixins/_reset-text.scss | 2 +- .../bootstrap5/mixins/_screen-reader.scss | 33 - .../components/bootstrap5/mixins/_size.scss | 6 - .../bootstrap5/mixins/_table-row.scss | 39 - .../bootstrap5/mixins/_table-variants.scss | 21 +- .../bootstrap5/mixins/_text-emphasis.scss | 14 - .../bootstrap5/mixins/_text-hide.scss | 13 - .../bootstrap5/mixins/_utilities.scss | 47 +- .../bootstrap5/mixins/_visibility.scss | 7 - .../bootstrap5/mixins/_visually-hidden.scss | 8 +- .../bootstrap5/utilities/_align.scss | 8 - .../bootstrap5/utilities/_background.scss | 19 - .../bootstrap5/utilities/_borders.scss | 63 -- .../bootstrap5/utilities/_clearfix.scss | 3 - .../bootstrap5/utilities/_display.scss | 38 - .../bootstrap5/utilities/_embed.scss | 41 - .../bootstrap5/utilities/_flex.scss | 51 -- .../bootstrap5/utilities/_float.scss | 9 - .../bootstrap5/utilities/_overflow.scss | 5 - .../bootstrap5/utilities/_position.scss | 32 - .../bootstrap5/utilities/_screenreaders.scss | 11 - .../bootstrap5/utilities/_shadows.scss | 6 - .../bootstrap5/utilities/_sizing.scss | 20 - .../bootstrap5/utilities/_spacing.scss | 73 -- .../bootstrap5/utilities/_text.scss | 67 -- .../bootstrap5/utilities/_visibility.scss | 11 - .../components/bootstrap5/vendor/_rfs.scss | 52 +- .../src/components/hamburgers/_base.scss | 2 +- .../components/hamburgers/types/_elastic.scss | 2 +- .../icons/fontawesome/_fontawesome.scss | 2 - .../popovers-tooltips/_popovers-tooltips.scss | 139 +++ .../src/components/tables/_datatables.scss | 236 ++++++ .../architect/src/elements/_badges.scss | 322 +++++++ .../architect/src/elements/_buttons.scss | 410 ++++++++- .../themes/architect/src/elements/_cards.scss | 54 +- .../architect/src/elements/_dropdown.scss | 215 ++++- .../themes/architect/src/elements/_forms.scss | 47 ++ .../themes/architect/src/elements/_navs.scss | 58 +- .../architect/src/elements/_pagination.scss | 10 + .../themes/architect/src/elements/_tabs.scss | 86 +- .../architect/src/elements/listgroup.scss | 30 +- .../themes/architect/src/layout/_layout.scss | 1 + .../elements/page-title/_page-title-base.scss | 6 +- .../elements/search-box/_search-box.scss | 7 +- .../src/layout/footer/_footer-base.scss | 45 +- .../src/layout/generic/_animations.scss | 45 + .../src/layout/generic/_generic-base.scss | 35 +- .../src/layout/header/_header-base.scss | 3 + .../architect/src/layout/main/_main-base.scss | 3 + .../layout/responsive/_responsive-base.scss | 40 +- .../src/layout/sidebar/_sidebar-base.scss | 2 +- .../sidebar/modifiers/_navmenu-vertical.scss | 4 +- .../src/themes/_layout-variables.scss | 33 +- .../src/themes/default/_variables.scss | 30 +- .../themes/architect/src/utils/_helpers.scss | 30 +- .../widgets/content-boxes/_content-boxes.scss | 6 +- 127 files changed, 4610 insertions(+), 2914 deletions(-) delete mode 100644 resources/themes/architect/src/components/bootstrap5/_custom-forms.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/_input-group.scss create mode 100644 resources/themes/architect/src/components/bootstrap5/_maps.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/_print.scss create mode 100644 resources/themes/architect/src/components/bootstrap5/_variables-dark.scss create mode 100644 resources/themes/architect/src/components/bootstrap5/helpers/_color-bg.scss create mode 100644 resources/themes/architect/src/components/bootstrap5/helpers/_focus-ring.scss create mode 100644 resources/themes/architect/src/components/bootstrap5/helpers/_icon-link.scss create mode 100644 resources/themes/architect/src/components/bootstrap5/helpers/_stacks.scss create mode 100644 resources/themes/architect/src/components/bootstrap5/helpers/_vr.scss create mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_backdrop.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_background-variant.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_badge.scss create mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_banner.scss create mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_color-mode.scss create mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_deprecate.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_float.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_grid-framework.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_hover.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_nav-divider.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_screen-reader.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_size.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_table-row.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_text-emphasis.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_text-hide.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/mixins/_visibility.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_align.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_background.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_borders.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_clearfix.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_display.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_embed.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_flex.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_float.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_overflow.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_position.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_screenreaders.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_shadows.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_sizing.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_spacing.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_text.scss delete mode 100644 resources/themes/architect/src/components/bootstrap5/utilities/_visibility.scss create mode 100644 resources/themes/architect/src/components/tables/_datatables.scss create mode 100644 resources/themes/architect/src/layout/generic/_animations.scss diff --git a/resources/themes/architect/src/app.js b/resources/themes/architect/src/app.js index c604e20c..ae1a0c82 100644 --- a/resources/themes/architect/src/app.js +++ b/resources/themes/architect/src/app.js @@ -7,7 +7,6 @@ import 'metismenu'; // Stylesheets // import './assets/base.scss'; -// import '../../themes/architect/src/base.scss'; $(document).ready(() => { diff --git a/resources/themes/architect/src/base.scss b/resources/themes/architect/src/base.scss index f7ba11ae..f0ea39a1 100644 --- a/resources/themes/architect/src/base.scss +++ b/resources/themes/architect/src/base.scss @@ -1,9 +1,9 @@ /*! ========================================================= - * ArchitectUI HTML Theme Dashboard - v2.0.0 + * ArchitectUI HTML Theme Dashboard - v4.0.0 ========================================================= * Product Page: https://dashboardpack.com - * Copyright 2021 DashboardPack (https://dashboardpack.com) + * Copyright 2023 DashboardPack (https://dashboardpack.com) * Licensed under MIT (https://github.com/DashboardPack/architectui-html-theme-free/blob/master/LICENSE) ========================================================= * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. @@ -21,6 +21,8 @@ // 3. Include remainder of required Bootstrap stylesheets @import "components/bootstrap5/variables"; +@import "components/bootstrap5/variables-dark"; +@import "components/bootstrap5/maps"; @import "components/bootstrap5/mixins"; @import "components/bootstrap5/utilities"; @@ -56,9 +58,10 @@ // @import "components/bootstrap5/carousel"; // @import "components/bootstrap5/spinners"; // @import "components/bootstrap5/offcanvas"; -// @import "components/bootstrap5/jumbotron"; +// @import "components/bootstrap5/placeholders"; @import "components/bootstrap5/helpers"; @import "components/bootstrap5/utilities/api"; + // LAYOUT @import "layout/layout"; diff --git a/resources/themes/architect/src/components/bootstrap5/_alert.scss b/resources/themes/architect/src/components/bootstrap5/_alert.scss index 34f1e84e..b8cff9b7 100644 --- a/resources/themes/architect/src/components/bootstrap5/_alert.scss +++ b/resources/themes/architect/src/components/bootstrap5/_alert.scss @@ -3,11 +3,25 @@ // .alert { + // scss-docs-start alert-css-vars + --#{$prefix}alert-bg: transparent; + --#{$prefix}alert-padding-x: #{$alert-padding-x}; + --#{$prefix}alert-padding-y: #{$alert-padding-y}; + --#{$prefix}alert-margin-bottom: #{$alert-margin-bottom}; + --#{$prefix}alert-color: inherit; + --#{$prefix}alert-border-color: transparent; + --#{$prefix}alert-border: #{$alert-border-width} solid var(--#{$prefix}alert-border-color); + --#{$prefix}alert-border-radius: #{$alert-border-radius}; + --#{$prefix}alert-link-color: inherit; + // scss-docs-end alert-css-vars + position: relative; - padding: $alert-padding-y $alert-padding-x; - margin-bottom: $alert-margin-bottom; - border: $alert-border-width solid transparent; - @include border-radius($alert-border-radius); + padding: var(--#{$prefix}alert-padding-y) var(--#{$prefix}alert-padding-x); + margin-bottom: var(--#{$prefix}alert-margin-bottom); + color: var(--#{$prefix}alert-color); + background-color: var(--#{$prefix}alert-bg); + border: var(--#{$prefix}alert-border); + @include border-radius(var(--#{$prefix}alert-border-radius)); } // Headings for larger alerts @@ -19,6 +33,7 @@ // Provide class for links that match alerts .alert-link { font-weight: $alert-link-font-weight; + color: var(--#{$prefix}alert-link-color); } @@ -41,17 +56,13 @@ // scss-docs-start alert-modifiers -// Generate contextual modifier classes for colorizing the alert. - -@each $state, $value in $theme-colors { - $alert-background: shift-color($value, $alert-bg-scale); - $alert-border: shift-color($value, $alert-border-scale); - $alert-color: shift-color($value, $alert-color-scale); - @if (contrast-ratio($alert-background, $alert-color) < $min-contrast-ratio) { - $alert-color: mix($value, color-contrast($alert-background), abs($alert-color-scale)); - } +// Generate contextual modifier classes for colorizing the alert +@each $state in map-keys($theme-colors) { .alert-#{$state} { - @include alert-variant($alert-background, $alert-border, $alert-color); + --#{$prefix}alert-color: var(--#{$prefix}#{$state}-text-emphasis); + --#{$prefix}alert-bg: var(--#{$prefix}#{$state}-bg-subtle); + --#{$prefix}alert-border-color: var(--#{$prefix}#{$state}-border-subtle); + --#{$prefix}alert-link-color: var(--#{$prefix}#{$state}-text-emphasis); } } // scss-docs-end alert-modifiers diff --git a/resources/themes/architect/src/components/bootstrap5/_badge.scss b/resources/themes/architect/src/components/bootstrap5/_badge.scss index 08df1b84..cc3d2695 100644 --- a/resources/themes/architect/src/components/bootstrap5/_badge.scss +++ b/resources/themes/architect/src/components/bootstrap5/_badge.scss @@ -4,16 +4,25 @@ // `background-color`. .badge { + // scss-docs-start badge-css-vars + --#{$prefix}badge-padding-x: #{$badge-padding-x}; + --#{$prefix}badge-padding-y: #{$badge-padding-y}; + @include rfs($badge-font-size, --#{$prefix}badge-font-size); + --#{$prefix}badge-font-weight: #{$badge-font-weight}; + --#{$prefix}badge-color: #{$badge-color}; + --#{$prefix}badge-border-radius: #{$badge-border-radius}; + // scss-docs-end badge-css-vars + display: inline-block; - padding: $badge-padding-y $badge-padding-x; - @include font-size($badge-font-size); - font-weight: $badge-font-weight; + padding: var(--#{$prefix}badge-padding-y) var(--#{$prefix}badge-padding-x); + @include font-size(var(--#{$prefix}badge-font-size)); + font-weight: var(--#{$prefix}badge-font-weight); line-height: 1; - color: $badge-color; + color: var(--#{$prefix}badge-color); text-align: center; white-space: nowrap; vertical-align: baseline; - @include border-radius($badge-border-radius); + @include border-radius(var(--#{$prefix}badge-border-radius)); @include gradient-bg(); // Empty badges collapse automatically diff --git a/resources/themes/architect/src/components/bootstrap5/_breadcrumb.scss b/resources/themes/architect/src/components/bootstrap5/_breadcrumb.scss index f7fafe74..b8252ff2 100644 --- a/resources/themes/architect/src/components/bootstrap5/_breadcrumb.scss +++ b/resources/themes/architect/src/components/bootstrap5/_breadcrumb.scss @@ -1,28 +1,40 @@ .breadcrumb { + // scss-docs-start breadcrumb-css-vars + --#{$prefix}breadcrumb-padding-x: #{$breadcrumb-padding-x}; + --#{$prefix}breadcrumb-padding-y: #{$breadcrumb-padding-y}; + --#{$prefix}breadcrumb-margin-bottom: #{$breadcrumb-margin-bottom}; + @include rfs($breadcrumb-font-size, --#{$prefix}breadcrumb-font-size); + --#{$prefix}breadcrumb-bg: #{$breadcrumb-bg}; + --#{$prefix}breadcrumb-border-radius: #{$breadcrumb-border-radius}; + --#{$prefix}breadcrumb-divider-color: #{$breadcrumb-divider-color}; + --#{$prefix}breadcrumb-item-padding-x: #{$breadcrumb-item-padding-x}; + --#{$prefix}breadcrumb-item-active-color: #{$breadcrumb-active-color}; + // scss-docs-end breadcrumb-css-vars + display: flex; flex-wrap: wrap; - padding: $breadcrumb-padding-y $breadcrumb-padding-x; - margin-bottom: $breadcrumb-margin-bottom; - @include font-size($breadcrumb-font-size); + padding: var(--#{$prefix}breadcrumb-padding-y) var(--#{$prefix}breadcrumb-padding-x); + margin-bottom: var(--#{$prefix}breadcrumb-margin-bottom); + @include font-size(var(--#{$prefix}breadcrumb-font-size)); list-style: none; - background-color: $breadcrumb-bg; - @include border-radius($breadcrumb-border-radius); + background-color: var(--#{$prefix}breadcrumb-bg); + @include border-radius(var(--#{$prefix}breadcrumb-border-radius)); } .breadcrumb-item { // The separator between breadcrumbs (by default, a forward-slash: "/") + .breadcrumb-item { - padding-left: $breadcrumb-item-padding-x; + padding-left: var(--#{$prefix}breadcrumb-item-padding-x); &::before { float: left; // Suppress inline spacings and underlining of the separator - padding-right: $breadcrumb-item-padding-x; - color: $breadcrumb-divider-color; - content: var(--#{$variable-prefix}breadcrumb-divider, escape-svg($breadcrumb-divider)) #{"/* rtl:"} var(--#{$variable-prefix}breadcrumb-divider, escape-svg($breadcrumb-divider-flipped)) #{"*/"}; + padding-right: var(--#{$prefix}breadcrumb-item-padding-x); + color: var(--#{$prefix}breadcrumb-divider-color); + content: var(--#{$prefix}breadcrumb-divider, escape-svg($breadcrumb-divider)) #{"/* rtl:"} var(--#{$prefix}breadcrumb-divider, escape-svg($breadcrumb-divider-flipped)) #{"*/"}; } } &.active { - color: $breadcrumb-active-color; + color: var(--#{$prefix}breadcrumb-item-active-color); } } diff --git a/resources/themes/architect/src/components/bootstrap5/_button-group.scss b/resources/themes/architect/src/components/bootstrap5/_button-group.scss index 13aa0569..55ae3f65 100644 --- a/resources/themes/architect/src/components/bootstrap5/_button-group.scss +++ b/resources/themes/architect/src/components/bootstrap5/_button-group.scss @@ -34,14 +34,17 @@ } .btn-group { + @include border-radius($btn-border-radius); + // Prevent double borders when buttons are next to each other - > .btn:not(:first-child), + > :not(.btn-check:first-child) + .btn, > .btn-group:not(:first-child) { - margin-left: -$btn-border-width; + margin-left: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list } // Reset rounded corners > .btn:not(:last-child):not(.dropdown-toggle), + > .btn.dropdown-toggle-split:first-child, > .btn-group:not(:last-child) > .btn { @include border-end-radius(0); } @@ -123,7 +126,7 @@ > .btn:not(:first-child), > .btn-group:not(:first-child) { - margin-top: -$btn-border-width; + margin-top: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list } // Reset rounded corners diff --git a/resources/themes/architect/src/components/bootstrap5/_buttons.scss b/resources/themes/architect/src/components/bootstrap5/_buttons.scss index ee4287c9..e14a1843 100644 --- a/resources/themes/architect/src/components/bootstrap5/_buttons.scss +++ b/resources/themes/architect/src/components/bootstrap5/_buttons.scss @@ -3,49 +3,112 @@ // .btn { + // scss-docs-start btn-css-vars + --#{$prefix}btn-padding-x: #{$btn-padding-x}; + --#{$prefix}btn-padding-y: #{$btn-padding-y}; + --#{$prefix}btn-font-family: #{$btn-font-family}; + @include rfs($btn-font-size, --#{$prefix}btn-font-size); + --#{$prefix}btn-font-weight: #{$btn-font-weight}; + --#{$prefix}btn-line-height: #{$btn-line-height}; + --#{$prefix}btn-color: #{$btn-color}; + --#{$prefix}btn-bg: transparent; + --#{$prefix}btn-border-width: #{$btn-border-width}; + --#{$prefix}btn-border-color: transparent; + --#{$prefix}btn-border-radius: #{$btn-border-radius}; + --#{$prefix}btn-hover-border-color: transparent; + --#{$prefix}btn-box-shadow: #{$btn-box-shadow}; + --#{$prefix}btn-disabled-opacity: #{$btn-disabled-opacity}; + --#{$prefix}btn-focus-box-shadow: 0 0 0 #{$btn-focus-width} rgba(var(--#{$prefix}btn-focus-shadow-rgb), .5); + // scss-docs-end btn-css-vars + display: inline-block; - font-family: $btn-font-family; - font-weight: $btn-font-weight; - line-height: $btn-line-height; - color: $body-color; + padding: var(--#{$prefix}btn-padding-y) var(--#{$prefix}btn-padding-x); + font-family: var(--#{$prefix}btn-font-family); + @include font-size(var(--#{$prefix}btn-font-size)); + font-weight: var(--#{$prefix}btn-font-weight); + line-height: var(--#{$prefix}btn-line-height); + color: var(--#{$prefix}btn-color); text-align: center; text-decoration: if($link-decoration == none, null, none); white-space: $btn-white-space; vertical-align: middle; cursor: if($enable-button-pointers, pointer, null); user-select: none; - background-color: transparent; - border: $btn-border-width solid transparent; - @include button-size($btn-padding-y, $btn-padding-x, $btn-font-size, $btn-border-radius); + border: var(--#{$prefix}btn-border-width) solid var(--#{$prefix}btn-border-color); + @include border-radius(var(--#{$prefix}btn-border-radius)); + @include gradient-bg(var(--#{$prefix}btn-bg)); + @include box-shadow(var(--#{$prefix}btn-box-shadow)); @include transition($btn-transition); &:hover { - color: $body-color; + color: var(--#{$prefix}btn-hover-color); text-decoration: if($link-hover-decoration == underline, none, null); + background-color: var(--#{$prefix}btn-hover-bg); + border-color: var(--#{$prefix}btn-hover-border-color); } - .btn-check:focus + &, - &:focus { + .btn-check + &:hover { + // override for the checkbox/radio buttons + color: var(--#{$prefix}btn-color); + background-color: var(--#{$prefix}btn-bg); + border-color: var(--#{$prefix}btn-border-color); + } + + &:focus-visible { + color: var(--#{$prefix}btn-hover-color); + @include gradient-bg(var(--#{$prefix}btn-hover-bg)); + border-color: var(--#{$prefix}btn-hover-border-color); outline: 0; - box-shadow: $btn-focus-box-shadow; + // Avoid using mixin so we can pass custom focus shadow properly + @if $enable-shadows { + box-shadow: var(--#{$prefix}btn-box-shadow), var(--#{$prefix}btn-focus-box-shadow); + } @else { + box-shadow: var(--#{$prefix}btn-focus-box-shadow); + } + } + + .btn-check:focus-visible + & { + border-color: var(--#{$prefix}btn-hover-border-color); + outline: 0; + // Avoid using mixin so we can pass custom focus shadow properly + @if $enable-shadows { + box-shadow: var(--#{$prefix}btn-box-shadow), var(--#{$prefix}btn-focus-box-shadow); + } @else { + box-shadow: var(--#{$prefix}btn-focus-box-shadow); + } } .btn-check:checked + &, - .btn-check:active + &, - &:active, - &.active { - @include box-shadow($btn-active-box-shadow); + :not(.btn-check) + &:active, + &:first-child:active, + &.active, + &.show { + color: var(--#{$prefix}btn-active-color); + background-color: var(--#{$prefix}btn-active-bg); + // Remove CSS gradients if they're enabled + background-image: if($enable-gradients, none, null); + border-color: var(--#{$prefix}btn-active-border-color); + @include box-shadow(var(--#{$prefix}btn-active-shadow)); - &:focus { - @include box-shadow($btn-focus-box-shadow, $btn-active-box-shadow); + &:focus-visible { + // Avoid using mixin so we can pass custom focus shadow properly + @if $enable-shadows { + box-shadow: var(--#{$prefix}btn-active-shadow), var(--#{$prefix}btn-focus-box-shadow); + } @else { + box-shadow: var(--#{$prefix}btn-focus-box-shadow); + } } } &:disabled, &.disabled, fieldset:disabled & { + color: var(--#{$prefix}btn-disabled-color); pointer-events: none; - opacity: $btn-disabled-opacity; + background-color: var(--#{$prefix}btn-disabled-bg); + background-image: if($enable-gradients, none, null); + border-color: var(--#{$prefix}btn-disabled-border-color); + opacity: var(--#{$prefix}btn-disabled-opacity); @include box-shadow(none); } } @@ -58,7 +121,27 @@ // scss-docs-start btn-variant-loops @each $color, $value in $theme-colors { .btn-#{$color} { - @include button-variant($value, $value); + @if $color == "light" { + @include button-variant( + $value, + $value, + $hover-background: shade-color($value, $btn-hover-bg-shade-amount), + $hover-border: shade-color($value, $btn-hover-border-shade-amount), + $active-background: shade-color($value, $btn-active-bg-shade-amount), + $active-border: shade-color($value, $btn-active-border-shade-amount) + ); + } @else if $color == "dark" { + @include button-variant( + $value, + $value, + $hover-background: tint-color($value, $btn-hover-bg-tint-amount), + $hover-border: tint-color($value, $btn-hover-border-tint-amount), + $active-background: tint-color($value, $btn-active-bg-tint-amount), + $active-border: tint-color($value, $btn-active-border-tint-amount) + ); + } @else { + @include button-variant($value, $value); + } } } @@ -76,22 +159,35 @@ // Make a button look and behave like a link .btn-link { - font-weight: $font-weight-normal; - color: $btn-link-color; + --#{$prefix}btn-font-weight: #{$font-weight-normal}; + --#{$prefix}btn-color: #{$btn-link-color}; + --#{$prefix}btn-bg: transparent; + --#{$prefix}btn-border-color: transparent; + --#{$prefix}btn-hover-color: #{$btn-link-hover-color}; + --#{$prefix}btn-hover-border-color: transparent; + --#{$prefix}btn-active-color: #{$btn-link-hover-color}; + --#{$prefix}btn-active-border-color: transparent; + --#{$prefix}btn-disabled-color: #{$btn-link-disabled-color}; + --#{$prefix}btn-disabled-border-color: transparent; + --#{$prefix}btn-box-shadow: 0 0 0 #000; // Can't use `none` as keyword negates all values when used with multiple shadows + --#{$prefix}btn-focus-shadow-rgb: #{$btn-link-focus-shadow-rgb}; + text-decoration: $link-decoration; + @if $enable-gradients { + background-image: none; + } + + &:hover, + &:focus-visible { + text-decoration: $link-hover-decoration; + } + + &:focus-visible { + color: var(--#{$prefix}btn-color); + } &:hover { - color: $btn-link-hover-color; - text-decoration: $link-hover-decoration; - } - - &:focus { - text-decoration: $link-hover-decoration; - } - - &:disabled, - &.disabled { - color: $btn-link-disabled-color; + color: var(--#{$prefix}btn-hover-color); } // No need for an active state here diff --git a/resources/themes/architect/src/components/bootstrap5/_card.scss b/resources/themes/architect/src/components/bootstrap5/_card.scss index b077858c..d3535a98 100644 --- a/resources/themes/architect/src/components/bootstrap5/_card.scss +++ b/resources/themes/architect/src/components/bootstrap5/_card.scss @@ -3,16 +3,40 @@ // .card { + // scss-docs-start card-css-vars + --#{$prefix}card-spacer-y: #{$card-spacer-y}; + --#{$prefix}card-spacer-x: #{$card-spacer-x}; + --#{$prefix}card-title-spacer-y: #{$card-title-spacer-y}; + --#{$prefix}card-title-color: #{$card-title-color}; + --#{$prefix}card-subtitle-color: #{$card-subtitle-color}; + --#{$prefix}card-border-width: #{$card-border-width}; + --#{$prefix}card-border-color: #{$card-border-color}; + --#{$prefix}card-border-radius: #{$card-border-radius}; + --#{$prefix}card-box-shadow: #{$card-box-shadow}; + --#{$prefix}card-inner-border-radius: #{$card-inner-border-radius}; + --#{$prefix}card-cap-padding-y: #{$card-cap-padding-y}; + --#{$prefix}card-cap-padding-x: #{$card-cap-padding-x}; + --#{$prefix}card-cap-bg: #{$card-cap-bg}; + --#{$prefix}card-cap-color: #{$card-cap-color}; + --#{$prefix}card-height: #{$card-height}; + --#{$prefix}card-color: #{$card-color}; + --#{$prefix}card-bg: #{$card-bg}; + --#{$prefix}card-img-overlay-padding: #{$card-img-overlay-padding}; + --#{$prefix}card-group-margin: #{$card-group-margin}; + // scss-docs-end card-css-vars + position: relative; display: flex; flex-direction: column; min-width: 0; // See https://github.com/twbs/bootstrap/pull/22740#issuecomment-305868106 - height: $card-height; + height: var(--#{$prefix}card-height); + color: var(--#{$prefix}body-color); word-wrap: break-word; - background-color: $card-bg; + background-color: var(--#{$prefix}card-bg); background-clip: border-box; - border: $card-border-width solid $card-border-color; - @include border-radius($card-border-radius); + border: var(--#{$prefix}card-border-width) solid var(--#{$prefix}card-border-color); + @include border-radius(var(--#{$prefix}card-border-radius)); + @include box-shadow(var(--#{$prefix}card-box-shadow)); > hr { margin-right: 0; @@ -25,12 +49,12 @@ &:first-child { border-top-width: 0; - @include border-top-radius($card-inner-border-radius); + @include border-top-radius(var(--#{$prefix}card-inner-border-radius)); } &:last-child { border-bottom-width: 0; - @include border-bottom-radius($card-inner-border-radius); + @include border-bottom-radius(var(--#{$prefix}card-inner-border-radius)); } } @@ -46,17 +70,19 @@ // Enable `flex-grow: 1` for decks and groups so that card blocks take up // as much space as possible, ensuring footers are aligned to the bottom. flex: 1 1 auto; - padding: $card-spacer-y $card-spacer-x; - color: $card-color; + padding: var(--#{$prefix}card-spacer-y) var(--#{$prefix}card-spacer-x); + color: var(--#{$prefix}card-color); } .card-title { - margin-bottom: $card-title-spacer-y; + margin-bottom: var(--#{$prefix}card-title-spacer-y); + color: var(--#{$prefix}card-title-color); } .card-subtitle { - margin-top: -$card-title-spacer-y * .5; + margin-top: calc(-.5 * var(--#{$prefix}card-title-spacer-y)); // stylelint-disable-line function-disallowed-list margin-bottom: 0; + color: var(--#{$prefix}card-subtitle-color); } .card-text:last-child { @@ -65,11 +91,11 @@ .card-link { &:hover { - text-decoration: none; + text-decoration: if($link-hover-decoration == underline, none, null); } + .card-link { - margin-left: $card-spacer-x; + margin-left: var(--#{$prefix}card-spacer-x); } } @@ -78,25 +104,25 @@ // .card-header { - padding: $card-cap-padding-y $card-cap-padding-x; + padding: var(--#{$prefix}card-cap-padding-y) var(--#{$prefix}card-cap-padding-x); margin-bottom: 0; // Removes the default margin-bottom of - color: $card-cap-color; - background-color: $card-cap-bg; - border-bottom: $card-border-width solid $card-border-color; + color: var(--#{$prefix}card-cap-color); + background-color: var(--#{$prefix}card-cap-bg); + border-bottom: var(--#{$prefix}card-border-width) solid var(--#{$prefix}card-border-color); &:first-child { - @include border-radius($card-inner-border-radius $card-inner-border-radius 0 0); + @include border-radius(var(--#{$prefix}card-inner-border-radius) var(--#{$prefix}card-inner-border-radius) 0 0); } } .card-footer { - padding: $card-cap-padding-y $card-cap-padding-x; - color: $card-cap-color; - background-color: $card-cap-bg; - border-top: $card-border-width solid $card-border-color; + padding: var(--#{$prefix}card-cap-padding-y) var(--#{$prefix}card-cap-padding-x); + color: var(--#{$prefix}card-cap-color); + background-color: var(--#{$prefix}card-cap-bg); + border-top: var(--#{$prefix}card-border-width) solid var(--#{$prefix}card-border-color); &:last-child { - @include border-radius(0 0 $card-inner-border-radius $card-inner-border-radius); + @include border-radius(0 0 var(--#{$prefix}card-inner-border-radius) var(--#{$prefix}card-inner-border-radius)); } } @@ -106,22 +132,20 @@ // .card-header-tabs { - margin-right: -$card-cap-padding-x * .5; - margin-bottom: -$card-cap-padding-y; - margin-left: -$card-cap-padding-x * .5; + margin-right: calc(-.5 * var(--#{$prefix}card-cap-padding-x)); // stylelint-disable-line function-disallowed-list + margin-bottom: calc(-1 * var(--#{$prefix}card-cap-padding-y)); // stylelint-disable-line function-disallowed-list + margin-left: calc(-.5 * var(--#{$prefix}card-cap-padding-x)); // stylelint-disable-line function-disallowed-list border-bottom: 0; - @if $nav-tabs-link-active-bg != $card-bg { - .nav-link.active { - background-color: $card-bg; - border-bottom-color: $card-bg; - } + .nav-link.active { + background-color: var(--#{$prefix}card-bg); + border-bottom-color: var(--#{$prefix}card-bg); } } .card-header-pills { - margin-right: -$card-cap-padding-x * .5; - margin-left: -$card-cap-padding-x * .5; + margin-right: calc(-.5 * var(--#{$prefix}card-cap-padding-x)); // stylelint-disable-line function-disallowed-list + margin-left: calc(-.5 * var(--#{$prefix}card-cap-padding-x)); // stylelint-disable-line function-disallowed-list } // Card image @@ -131,8 +155,8 @@ right: 0; bottom: 0; left: 0; - padding: $card-img-overlay-padding; - @include border-radius($card-inner-border-radius); + padding: var(--#{$prefix}card-img-overlay-padding); + @include border-radius(var(--#{$prefix}card-inner-border-radius)); } .card-img, @@ -143,12 +167,12 @@ .card-img, .card-img-top { - @include border-top-radius($card-inner-border-radius); + @include border-top-radius(var(--#{$prefix}card-inner-border-radius)); } .card-img, .card-img-bottom { - @include border-bottom-radius($card-inner-border-radius); + @include border-bottom-radius(var(--#{$prefix}card-inner-border-radius)); } @@ -160,7 +184,7 @@ // The child selector allows nested `.card` within `.card-group` // to display properly. > .card { - margin-bottom: $card-group-margin; + margin-bottom: var(--#{$prefix}card-group-margin); } @include media-breakpoint-up(sm) { diff --git a/resources/themes/architect/src/components/bootstrap5/_close.scss b/resources/themes/architect/src/components/bootstrap5/_close.scss index 32a0f68c..4d6e73c1 100644 --- a/resources/themes/architect/src/components/bootstrap5/_close.scss +++ b/resources/themes/architect/src/components/bootstrap5/_close.scss @@ -1,40 +1,63 @@ -// transparent background and border properties included for button version. +// Transparent background and border properties included for button version. // iOS requires the button element instead of an anchor tag. // If you want the anchor version, it requires `href="#"`. // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile .btn-close { + // scss-docs-start close-css-vars + --#{$prefix}btn-close-color: #{$btn-close-color}; + --#{$prefix}btn-close-bg: #{ escape-svg($btn-close-bg) }; + --#{$prefix}btn-close-opacity: #{$btn-close-opacity}; + --#{$prefix}btn-close-hover-opacity: #{$btn-close-hover-opacity}; + --#{$prefix}btn-close-focus-shadow: #{$btn-close-focus-shadow}; + --#{$prefix}btn-close-focus-opacity: #{$btn-close-focus-opacity}; + --#{$prefix}btn-close-disabled-opacity: #{$btn-close-disabled-opacity}; + --#{$prefix}btn-close-white-filter: #{$btn-close-white-filter}; + // scss-docs-end close-css-vars + box-sizing: content-box; width: $btn-close-width; height: $btn-close-height; padding: $btn-close-padding-y $btn-close-padding-x; - color: $btn-close-color; - background: transparent escape-svg($btn-close-bg) center / $btn-close-width auto no-repeat; // include transparent for button elements + color: var(--#{$prefix}btn-close-color); + background: transparent var(--#{$prefix}btn-close-bg) center / $btn-close-width auto no-repeat; // include transparent for button elements border: 0; // for button elements @include border-radius(); - opacity: $btn-close-opacity; + opacity: var(--#{$prefix}btn-close-opacity); // Override 's hover style &:hover { - color: $btn-close-color; + color: var(--#{$prefix}btn-close-color); text-decoration: none; - opacity: $btn-close-hover-opacity; + opacity: var(--#{$prefix}btn-close-hover-opacity); } &:focus { outline: 0; - box-shadow: $btn-close-focus-shadow; - opacity: $btn-close-focus-opacity; + box-shadow: var(--#{$prefix}btn-close-focus-shadow); + opacity: var(--#{$prefix}btn-close-focus-opacity); } &:disabled, &.disabled { pointer-events: none; user-select: none; - opacity: $btn-close-disabled-opacity; + opacity: var(--#{$prefix}btn-close-disabled-opacity); } } -.btn-close-white { - filter: $btn-close-white-filter; +@mixin btn-close-white() { + filter: var(--#{$prefix}btn-close-white-filter); +} + +.btn-close-white { + @include btn-close-white(); +} + +@if $enable-dark-mode { + @include color-mode(dark) { + .btn-close { + @include btn-close-white(); + } + } } diff --git a/resources/themes/architect/src/components/bootstrap5/_containers.scss b/resources/themes/architect/src/components/bootstrap5/_containers.scss index f88f1e5f..83b31381 100644 --- a/resources/themes/architect/src/components/bootstrap5/_containers.scss +++ b/resources/themes/architect/src/components/bootstrap5/_containers.scss @@ -2,7 +2,7 @@ // // Set the container width, and override it for fixed navbars in media queries. -@if $enable-grid-classes { +@if $enable-container-classes { // Single container class with breakpoint max-widths .container, // 100% wide container at all breakpoints diff --git a/resources/themes/architect/src/components/bootstrap5/_custom-forms.scss b/resources/themes/architect/src/components/bootstrap5/_custom-forms.scss deleted file mode 100644 index 63292549..00000000 --- a/resources/themes/architect/src/components/bootstrap5/_custom-forms.scss +++ /dev/null @@ -1,507 +0,0 @@ -// Embedded icons from Open Iconic. -// Released under MIT and copyright 2014 Waybury. -// https://useiconic.com/open - - -// Checkboxes and radios -// -// Base class takes care of all the key behavioral aspects. - -.custom-control { - position: relative; - display: block; - min-height: $font-size-base * $line-height-base; - padding-left: $custom-control-gutter + $custom-control-indicator-size; -} - -.custom-control-inline { - display: inline-flex; - margin-right: $custom-control-spacer-x; -} - -.custom-control-input { - position: absolute; - z-index: -1; // Put the input behind the label so it doesn't overlay text - opacity: 0; - - &:checked ~ .custom-control-label::before { - color: $custom-control-indicator-checked-color; - border-color: $custom-control-indicator-checked-border-color; - @include gradient-bg($custom-control-indicator-checked-bg); - @include box-shadow($custom-control-indicator-checked-box-shadow); - } - - &:focus ~ .custom-control-label::before { - // the mixin is not used here to make sure there is feedback - @if $enable-shadows { - box-shadow: $input-box-shadow, $input-focus-box-shadow; - } @else { - box-shadow: $custom-control-indicator-focus-box-shadow; - } - } - - &:focus:not(:checked) ~ .custom-control-label::before { - border-color: $custom-control-indicator-focus-border-color; - } - - &:not(:disabled):active ~ .custom-control-label::before { - color: $custom-control-indicator-active-color; - background-color: $custom-control-indicator-active-bg; - border-color: $custom-control-indicator-active-border-color; - @include box-shadow($custom-control-indicator-active-box-shadow); - } - - &:disabled { - ~ .custom-control-label { - color: $custom-control-label-disabled-color; - - &::before { - background-color: $custom-control-indicator-disabled-bg; - } - } - } -} - -// Custom control indicators -// -// Build the custom controls out of pseudo-elements. - -.custom-control-label { - position: relative; - margin-bottom: 0; - vertical-align: top; - - // Background-color and (when enabled) gradient - &::before { - position: absolute; - top: ($font-size-base * $line-height-base - $custom-control-indicator-size) * 0.5; - left: -($custom-control-gutter + $custom-control-indicator-size); - display: block; - width: $custom-control-indicator-size; - height: $custom-control-indicator-size; - pointer-events: none; - content: ""; - background-color: $custom-control-indicator-bg; - border: $custom-control-indicator-border-color solid $custom-control-indicator-border-width; - @include box-shadow($custom-control-indicator-box-shadow); - } - - // Foreground (icon) - &::after { - position: absolute; - top: ($font-size-base * $line-height-base - $custom-control-indicator-size) * 0.5; - left: -($custom-control-gutter + $custom-control-indicator-size); - display: block; - width: $custom-control-indicator-size; - height: $custom-control-indicator-size; - content: ""; - background-repeat: no-repeat; - background-position: center center; - background-size: $custom-control-indicator-bg-size; - } -} - - -// Checkboxes -// -// Tweak just a few things for checkboxes. - -.custom-checkbox { - .custom-control-label::before { - @include border-radius($custom-checkbox-indicator-border-radius); - } - - .custom-control-input:checked ~ .custom-control-label { - &::after { - background-image: $custom-checkbox-indicator-icon-checked; - } - } - - .custom-control-input:indeterminate ~ .custom-control-label { - &::before { - border-color: $custom-checkbox-indicator-indeterminate-border-color; - @include gradient-bg($custom-checkbox-indicator-indeterminate-bg); - @include box-shadow($custom-checkbox-indicator-indeterminate-box-shadow); - } - &::after { - background-image: $custom-checkbox-indicator-icon-indeterminate; - } - } - - .custom-control-input:disabled { - &:checked ~ .custom-control-label::before { - background-color: $custom-control-indicator-checked-disabled-bg; - } - &:indeterminate ~ .custom-control-label::before { - background-color: $custom-control-indicator-checked-disabled-bg; - } - } -} - -// Radios -// -// Tweak just a few things for radios. - -.custom-radio { - .custom-control-label::before { - border-radius: $custom-radio-indicator-border-radius; - } - - .custom-control-input:checked ~ .custom-control-label { - &::after { - background-image: $custom-radio-indicator-icon-checked; - } - } - - .custom-control-input:disabled { - &:checked ~ .custom-control-label::before { - background-color: $custom-control-indicator-checked-disabled-bg; - } - } -} - - -// switches -// -// Tweak a few things for switches - -.custom-switch { - padding-left: $custom-switch-width + $custom-control-gutter; - - .custom-control-label { - &::before { - left: -($custom-switch-width + $custom-control-gutter); - width: $custom-switch-width; - pointer-events: all; - border-radius: $custom-switch-indicator-border-radius; - } - - &::after { - top: calc(#{(($font-size-base * $line-height-base - $custom-control-indicator-size) * 0.5)} + #{$custom-control-indicator-border-width * 2}); - left: calc(#{-($custom-switch-width + $custom-control-gutter)} + #{$custom-control-indicator-border-width * 2}); - width: $custom-switch-indicator-size; - height: $custom-switch-indicator-size; - background-color: $custom-control-indicator-border-color; - border-radius: $custom-switch-indicator-border-radius; - @include transition(transform .15s ease-in-out, $custom-forms-transition); - } - } - - .custom-control-input:checked ~ .custom-control-label { - &::after { - background-color: $custom-control-indicator-bg; - transform: translateX($custom-switch-width - $custom-control-indicator-size); - } - } - - .custom-control-input:disabled { - &:checked ~ .custom-control-label::before { - background-color: $custom-control-indicator-checked-disabled-bg; - } - } -} - - -// Select -// -// Replaces the browser default select with a custom one, mostly pulled from -// https://primer.github.io/. -// - -.custom-select { - display: inline-block; - width: 100%; - height: $custom-select-height; - padding: $custom-select-padding-y ($custom-select-padding-x + $custom-select-indicator-padding) $custom-select-padding-y $custom-select-padding-x; - font-weight: $custom-select-font-weight; - line-height: $custom-select-line-height; - color: $custom-select-color; - vertical-align: middle; - background: $custom-select-background; - background-color: $custom-select-bg; - border: $custom-select-border-width solid $custom-select-border-color; - @if $enable-rounded { - border-radius: $custom-select-border-radius; - } @else { - border-radius: 0; - } - @include box-shadow($custom-select-box-shadow); - appearance: none; - - &:focus { - border-color: $custom-select-focus-border-color; - outline: 0; - @if $enable-shadows { - box-shadow: $custom-select-box-shadow, $custom-select-focus-box-shadow; - } @else { - box-shadow: $custom-select-focus-box-shadow; - } - - &::-ms-value { - // For visual consistency with other platforms/browsers, - // suppress the default white text on blue background highlight given to - // the selected option text when the (still closed) s in some browsers, due to the limited stylability of `