From 71961ca1d12c93a29597419892bd5679b77d0235 Mon Sep 17 00:00:00 2001 From: badbuta Date: Fri, 7 Nov 2025 00:44:07 +0800 Subject: [PATCH] Initial commit --- .gitignore | 22 + Gemfile | 19 + Gemfile.lock | 96 + _config.yml | 82 + _layouts/default.html | 43 + _plugins/breadcrumbs.rb | 82 + _plugins/drops/breadcrumb_item.rb | 29 + _plugins/file_filters.rb | 9 + _plugins/relative_path_filters.rb | 81 + _plugins/string_filters.rb | 9 + _sass/_bootstrap-selective.sass | 61 + _sass/_custom-variables.sass | 16 + _sass/_my-project-components.sass | 2 + _sass/_my-project-styles.sass | 7 + _sass/bootstrap5/_accordion.scss | 153 ++ _sass/bootstrap5/_alert.scss | 68 + _sass/bootstrap5/_badge.scss | 38 + _sass/bootstrap5/_breadcrumb.scss | 40 + _sass/bootstrap5/_button-group.scss | 147 ++ _sass/bootstrap5/_buttons.scss | 216 ++ _sass/bootstrap5/_card.scss | 238 +++ _sass/bootstrap5/_carousel.scss | 226 +++ _sass/bootstrap5/_close.scss | 66 + _sass/bootstrap5/_containers.scss | 41 + _sass/bootstrap5/_dropdown.scss | 250 +++ _sass/bootstrap5/_forms.scss | 9 + _sass/bootstrap5/_functions.scss | 302 +++ _sass/bootstrap5/_grid.scss | 39 + _sass/bootstrap5/_helpers.scss | 12 + _sass/bootstrap5/_images.scss | 42 + _sass/bootstrap5/_list-group.scss | 199 ++ _sass/bootstrap5/_maps.scss | 174 ++ _sass/bootstrap5/_mixins.scss | 42 + _sass/bootstrap5/_modal.scss | 240 +++ _sass/bootstrap5/_nav.scss | 197 ++ _sass/bootstrap5/_navbar.scss | 289 +++ _sass/bootstrap5/_offcanvas.scss | 147 ++ _sass/bootstrap5/_pagination.scss | 109 + _sass/bootstrap5/_placeholders.scss | 51 + _sass/bootstrap5/_popover.scss | 196 ++ _sass/bootstrap5/_progress.scss | 68 + _sass/bootstrap5/_reboot.scss | 617 ++++++ _sass/bootstrap5/_root.scss | 187 ++ _sass/bootstrap5/_spinners.scss | 86 + _sass/bootstrap5/_tables.scss | 171 ++ _sass/bootstrap5/_toasts.scss | 73 + _sass/bootstrap5/_tooltip.scss | 119 ++ _sass/bootstrap5/_transitions.scss | 27 + _sass/bootstrap5/_type.scss | 106 + _sass/bootstrap5/_utilities.scss | 806 ++++++++ _sass/bootstrap5/_variables-dark.scss | 102 + _sass/bootstrap5/_variables.scss | 1753 +++++++++++++++++ _sass/bootstrap5/bootstrap-grid.scss | 62 + _sass/bootstrap5/bootstrap-reboot.scss | 10 + _sass/bootstrap5/bootstrap-utilities.scss | 19 + _sass/bootstrap5/bootstrap.scss | 52 + _sass/bootstrap5/forms/_floating-labels.scss | 97 + _sass/bootstrap5/forms/_form-check.scss | 189 ++ _sass/bootstrap5/forms/_form-control.scss | 214 ++ _sass/bootstrap5/forms/_form-range.scss | 91 + _sass/bootstrap5/forms/_form-select.scss | 80 + _sass/bootstrap5/forms/_form-text.scss | 11 + _sass/bootstrap5/forms/_input-group.scss | 132 ++ _sass/bootstrap5/forms/_labels.scss | 36 + _sass/bootstrap5/forms/_validation.scss | 12 + _sass/bootstrap5/helpers/_clearfix.scss | 3 + _sass/bootstrap5/helpers/_color-bg.scss | 7 + _sass/bootstrap5/helpers/_colored-links.scss | 30 + _sass/bootstrap5/helpers/_focus-ring.scss | 5 + _sass/bootstrap5/helpers/_icon-link.scss | 25 + _sass/bootstrap5/helpers/_position.scss | 36 + _sass/bootstrap5/helpers/_ratio.scss | 26 + _sass/bootstrap5/helpers/_stacks.scss | 15 + _sass/bootstrap5/helpers/_stretched-link.scss | 15 + .../bootstrap5/helpers/_text-truncation.scss | 7 + .../bootstrap5/helpers/_visually-hidden.scss | 8 + _sass/bootstrap5/helpers/_vr.scss | 8 + _sass/bootstrap5/mixins/_alert.scss | 18 + _sass/bootstrap5/mixins/_backdrop.scss | 14 + _sass/bootstrap5/mixins/_banner.scss | 7 + _sass/bootstrap5/mixins/_border-radius.scss | 78 + _sass/bootstrap5/mixins/_box-shadow.scss | 24 + _sass/bootstrap5/mixins/_breakpoints.scss | 127 ++ _sass/bootstrap5/mixins/_buttons.scss | 70 + _sass/bootstrap5/mixins/_caret.scss | 69 + _sass/bootstrap5/mixins/_clearfix.scss | 9 + _sass/bootstrap5/mixins/_color-mode.scss | 21 + _sass/bootstrap5/mixins/_color-scheme.scss | 7 + _sass/bootstrap5/mixins/_container.scss | 11 + _sass/bootstrap5/mixins/_deprecate.scss | 10 + _sass/bootstrap5/mixins/_forms.scss | 163 ++ _sass/bootstrap5/mixins/_gradients.scss | 47 + _sass/bootstrap5/mixins/_grid.scss | 151 ++ _sass/bootstrap5/mixins/_image.scss | 16 + _sass/bootstrap5/mixins/_list-group.scss | 26 + _sass/bootstrap5/mixins/_lists.scss | 7 + _sass/bootstrap5/mixins/_pagination.scss | 10 + _sass/bootstrap5/mixins/_reset-text.scss | 17 + _sass/bootstrap5/mixins/_resize.scss | 6 + _sass/bootstrap5/mixins/_table-variants.scss | 24 + _sass/bootstrap5/mixins/_text-truncate.scss | 8 + _sass/bootstrap5/mixins/_transition.scss | 26 + _sass/bootstrap5/mixins/_utilities.scss | 97 + _sass/bootstrap5/mixins/_visually-hidden.scss | 38 + _sass/bootstrap5/tests/jasmine.js | 16 + .../_auto-import-of-variables-dark.test.scss | 7 + .../tests/mixins/_box-shadow.test.scss | 188 ++ .../tests/mixins/_color-contrast.test.scss | 139 ++ .../tests/mixins/_color-modes.test.scss | 69 + .../_media-query-color-mode-full.test.scss | 8 + .../tests/mixins/_utilities.test.scss | 393 ++++ _sass/bootstrap5/tests/sass-true/register.js | 14 + _sass/bootstrap5/tests/sass-true/runner.js | 17 + .../bootstrap5/tests/utilities/_api.test.scss | 75 + _sass/bootstrap5/utilities/_api.scss | 47 + _sass/bootstrap5/vendor/_rfs.scss | 348 ++++ assets/css/main.sass | 19 + assets/js/main.js | 0 .../bootstrap5/css/bootstrap-icons.min.css | 5 + .../bootstrap5/css/fonts/bootstrap-icons.woff | Bin 0 -> 180288 bytes .../css/fonts/bootstrap-icons.woff2 | Bin 0 -> 134044 bytes .../bootstrap5/js/bootstrap.bundle.min.js | 7 + .../bootstrap5/js/bootstrap.bundle.min.js.map | 1 + assets/vendor/bootstrap5/js/bootstrap.min.js | 7 + .../vendor/bootstrap5/js/bootstrap.min.js.map | 1 + index.html | 63 + 126 files changed, 11919 insertions(+) create mode 100644 .gitignore create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 _config.yml create mode 100644 _layouts/default.html create mode 100644 _plugins/breadcrumbs.rb create mode 100644 _plugins/drops/breadcrumb_item.rb create mode 100644 _plugins/file_filters.rb create mode 100644 _plugins/relative_path_filters.rb create mode 100644 _plugins/string_filters.rb create mode 100644 _sass/_bootstrap-selective.sass create mode 100644 _sass/_custom-variables.sass create mode 100644 _sass/_my-project-components.sass create mode 100644 _sass/_my-project-styles.sass create mode 100644 _sass/bootstrap5/_accordion.scss create mode 100644 _sass/bootstrap5/_alert.scss create mode 100644 _sass/bootstrap5/_badge.scss create mode 100644 _sass/bootstrap5/_breadcrumb.scss create mode 100644 _sass/bootstrap5/_button-group.scss create mode 100644 _sass/bootstrap5/_buttons.scss create mode 100644 _sass/bootstrap5/_card.scss create mode 100644 _sass/bootstrap5/_carousel.scss create mode 100644 _sass/bootstrap5/_close.scss create mode 100644 _sass/bootstrap5/_containers.scss create mode 100644 _sass/bootstrap5/_dropdown.scss create mode 100644 _sass/bootstrap5/_forms.scss create mode 100644 _sass/bootstrap5/_functions.scss create mode 100644 _sass/bootstrap5/_grid.scss create mode 100644 _sass/bootstrap5/_helpers.scss create mode 100644 _sass/bootstrap5/_images.scss create mode 100644 _sass/bootstrap5/_list-group.scss create mode 100644 _sass/bootstrap5/_maps.scss create mode 100644 _sass/bootstrap5/_mixins.scss create mode 100644 _sass/bootstrap5/_modal.scss create mode 100644 _sass/bootstrap5/_nav.scss create mode 100644 _sass/bootstrap5/_navbar.scss create mode 100644 _sass/bootstrap5/_offcanvas.scss create mode 100644 _sass/bootstrap5/_pagination.scss create mode 100644 _sass/bootstrap5/_placeholders.scss create mode 100644 _sass/bootstrap5/_popover.scss create mode 100644 _sass/bootstrap5/_progress.scss create mode 100644 _sass/bootstrap5/_reboot.scss create mode 100644 _sass/bootstrap5/_root.scss create mode 100644 _sass/bootstrap5/_spinners.scss create mode 100644 _sass/bootstrap5/_tables.scss create mode 100644 _sass/bootstrap5/_toasts.scss create mode 100644 _sass/bootstrap5/_tooltip.scss create mode 100644 _sass/bootstrap5/_transitions.scss create mode 100644 _sass/bootstrap5/_type.scss create mode 100644 _sass/bootstrap5/_utilities.scss create mode 100644 _sass/bootstrap5/_variables-dark.scss create mode 100644 _sass/bootstrap5/_variables.scss create mode 100644 _sass/bootstrap5/bootstrap-grid.scss create mode 100644 _sass/bootstrap5/bootstrap-reboot.scss create mode 100644 _sass/bootstrap5/bootstrap-utilities.scss create mode 100644 _sass/bootstrap5/bootstrap.scss create mode 100644 _sass/bootstrap5/forms/_floating-labels.scss create mode 100644 _sass/bootstrap5/forms/_form-check.scss create mode 100644 _sass/bootstrap5/forms/_form-control.scss create mode 100644 _sass/bootstrap5/forms/_form-range.scss create mode 100644 _sass/bootstrap5/forms/_form-select.scss create mode 100644 _sass/bootstrap5/forms/_form-text.scss create mode 100644 _sass/bootstrap5/forms/_input-group.scss create mode 100644 _sass/bootstrap5/forms/_labels.scss create mode 100644 _sass/bootstrap5/forms/_validation.scss create mode 100644 _sass/bootstrap5/helpers/_clearfix.scss create mode 100644 _sass/bootstrap5/helpers/_color-bg.scss create mode 100644 _sass/bootstrap5/helpers/_colored-links.scss create mode 100644 _sass/bootstrap5/helpers/_focus-ring.scss create mode 100644 _sass/bootstrap5/helpers/_icon-link.scss create mode 100644 _sass/bootstrap5/helpers/_position.scss create mode 100644 _sass/bootstrap5/helpers/_ratio.scss create mode 100644 _sass/bootstrap5/helpers/_stacks.scss create mode 100644 _sass/bootstrap5/helpers/_stretched-link.scss create mode 100644 _sass/bootstrap5/helpers/_text-truncation.scss create mode 100644 _sass/bootstrap5/helpers/_visually-hidden.scss create mode 100644 _sass/bootstrap5/helpers/_vr.scss create mode 100644 _sass/bootstrap5/mixins/_alert.scss create mode 100644 _sass/bootstrap5/mixins/_backdrop.scss create mode 100644 _sass/bootstrap5/mixins/_banner.scss create mode 100644 _sass/bootstrap5/mixins/_border-radius.scss create mode 100644 _sass/bootstrap5/mixins/_box-shadow.scss create mode 100644 _sass/bootstrap5/mixins/_breakpoints.scss create mode 100644 _sass/bootstrap5/mixins/_buttons.scss create mode 100644 _sass/bootstrap5/mixins/_caret.scss create mode 100644 _sass/bootstrap5/mixins/_clearfix.scss create mode 100644 _sass/bootstrap5/mixins/_color-mode.scss create mode 100644 _sass/bootstrap5/mixins/_color-scheme.scss create mode 100644 _sass/bootstrap5/mixins/_container.scss create mode 100644 _sass/bootstrap5/mixins/_deprecate.scss create mode 100644 _sass/bootstrap5/mixins/_forms.scss create mode 100644 _sass/bootstrap5/mixins/_gradients.scss create mode 100644 _sass/bootstrap5/mixins/_grid.scss create mode 100644 _sass/bootstrap5/mixins/_image.scss create mode 100644 _sass/bootstrap5/mixins/_list-group.scss create mode 100644 _sass/bootstrap5/mixins/_lists.scss create mode 100644 _sass/bootstrap5/mixins/_pagination.scss create mode 100644 _sass/bootstrap5/mixins/_reset-text.scss create mode 100644 _sass/bootstrap5/mixins/_resize.scss create mode 100644 _sass/bootstrap5/mixins/_table-variants.scss create mode 100644 _sass/bootstrap5/mixins/_text-truncate.scss create mode 100644 _sass/bootstrap5/mixins/_transition.scss create mode 100644 _sass/bootstrap5/mixins/_utilities.scss create mode 100644 _sass/bootstrap5/mixins/_visually-hidden.scss create mode 100644 _sass/bootstrap5/tests/jasmine.js create mode 100644 _sass/bootstrap5/tests/mixins/_auto-import-of-variables-dark.test.scss create mode 100644 _sass/bootstrap5/tests/mixins/_box-shadow.test.scss create mode 100644 _sass/bootstrap5/tests/mixins/_color-contrast.test.scss create mode 100644 _sass/bootstrap5/tests/mixins/_color-modes.test.scss create mode 100644 _sass/bootstrap5/tests/mixins/_media-query-color-mode-full.test.scss create mode 100644 _sass/bootstrap5/tests/mixins/_utilities.test.scss create mode 100644 _sass/bootstrap5/tests/sass-true/register.js create mode 100644 _sass/bootstrap5/tests/sass-true/runner.js create mode 100644 _sass/bootstrap5/tests/utilities/_api.test.scss create mode 100644 _sass/bootstrap5/utilities/_api.scss create mode 100644 _sass/bootstrap5/vendor/_rfs.scss create mode 100644 assets/css/main.sass create mode 100644 assets/js/main.js create mode 100644 assets/vendor/bootstrap5/css/bootstrap-icons.min.css create mode 100644 assets/vendor/bootstrap5/css/fonts/bootstrap-icons.woff create mode 100644 assets/vendor/bootstrap5/css/fonts/bootstrap-icons.woff2 create mode 100644 assets/vendor/bootstrap5/js/bootstrap.bundle.min.js create mode 100644 assets/vendor/bootstrap5/js/bootstrap.bundle.min.js.map create mode 100644 assets/vendor/bootstrap5/js/bootstrap.min.js create mode 100644 assets/vendor/bootstrap5/js/bootstrap.min.js.map create mode 100644 index.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..23fbc34 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Jekyll-specific files +_site/ +.jekyll-cache/ +.sass-cache/ +.bundle/ + +# NodeJS-specific files +node_modules/ +npm-debug.log* +yarn-*.log* + + +# Vendor directory for Bundler +./vendor/ + +# Configuration and environment files +.env +.DS_Store # macOS specific +Thumbs.db # Windows specific + +# Log files +*.log diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..db04c8d --- /dev/null +++ b/Gemfile @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +# gem "rails" +gem "jekyll", "=4.4.1" +# gem "webrick", "=1.9.1" + +group :jekyll_plugins do + # gem "jekyll-seo-tag" + # gem "jekyll-sitemap" + # gem "jekyll-feed" + gem "execjs", "= 2.7" + gem "jekyll-autoprefixer" +# gem 'jekyll-relative-links' +end + +# For windows platform only: +# gem "wdm", platforms: [:windows] \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..aa4c349 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,96 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + autoprefixer-rails (9.8.6.5) + execjs + base64 (0.3.0) + bigdecimal (3.3.1) + colorator (1.1.0) + concurrent-ruby (1.3.5) + csv (3.3.5) + em-websocket (0.5.3) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0) + eventmachine (1.2.7) + execjs (2.7.0) + ffi (1.17.2-x64-mingw-ucrt) + ffi (1.17.2-x86_64-linux-gnu) + forwardable-extended (2.6.0) + google-protobuf (4.32.1-x64-mingw-ucrt) + bigdecimal + rake (>= 13) + google-protobuf (4.32.1-x86_64-linux-gnu) + bigdecimal + rake (>= 13) + http_parser.rb (0.8.0) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + jekyll (4.4.1) + addressable (~> 2.4) + base64 (~> 0.2) + colorator (~> 1.0) + csv (~> 3.0) + em-websocket (~> 0.5) + i18n (~> 1.0) + jekyll-sass-converter (>= 2.0, < 4.0) + jekyll-watch (~> 2.0) + json (~> 2.6) + kramdown (~> 2.3, >= 2.3.1) + kramdown-parser-gfm (~> 1.0) + liquid (~> 4.0) + mercenary (~> 0.3, >= 0.3.6) + pathutil (~> 0.9) + rouge (>= 3.0, < 5.0) + safe_yaml (~> 1.0) + terminal-table (>= 1.8, < 4.0) + webrick (~> 1.7) + jekyll-autoprefixer (1.0.2) + autoprefixer-rails (~> 9.3) + jekyll-sass-converter (3.1.0) + sass-embedded (~> 1.75) + jekyll-watch (2.2.1) + listen (~> 3.0) + json (2.15.1) + kramdown (2.5.1) + rexml (>= 3.3.9) + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.4) + listen (3.9.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.4.0) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (6.0.2) + rake (13.3.0) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + rexml (3.4.4) + rouge (4.6.1) + safe_yaml (1.0.5) + sass-embedded (1.93.2-x64-mingw-ucrt) + google-protobuf (~> 4.31) + sass-embedded (1.93.2-x86_64-linux-gnu) + google-protobuf (~> 4.31) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + unicode-display_width (2.6.0) + wdm (0.2.0) + webrick (1.9.1) + +PLATFORMS + x64-mingw-ucrt + x86_64-linux + +DEPENDENCIES + execjs (= 2.7) + jekyll (= 4.4.1) + jekyll-autoprefixer + wdm + +BUNDLED WITH + 2.7.2 diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..fc2d704 --- /dev/null +++ b/_config.yml @@ -0,0 +1,82 @@ +# ------------------------------------------ +# Override default settings here +# See: https://jekyllrb.com/docs/configuration/ +# ------------------------------------------ +baseurl: "" # for root deployment +url: "" + +# -- Multilingual support +languages: ["en", "tc", "sc"] +default_lang: "en" +exclude_from_localization: ["assets", "images"] + +# -- Permalink settings +# NOTE: Permalinks = pretty, will create /about/index.html instead of /about.html +# permalink: pretty + +# -- Stylesheet settings +sass: +# See: https://github.com/jekyll/jekyll-sass-converter#usage + style: compressed + # For Bootstrap 5 SCSS, SaSS reported deprecation warnings, + # to suppress them, set the following option to true + quiet_deps: true + +# -- Plugins +# plugins: +# - jekyll-sitemap +# - jekyll-autoprefixer + +# -- Plugins: Autoprefixer settings +# NOTE: Autoprefixer is disabled at Windows environment due to build issues. +# autoprefixer: +# browsers: +# - last 4 versions + +# -- Plugins: _plugin/relative_path_filters.rb settings +# Use this filter to handle local/production differences in baseurl +# and to convert absolute paths to relative paths. +RelativePathFilter: + enabled: true + +# -- Plugins: _plugin/breadcrumbs.rb settings +breadcrumbs: + root: + hide: true # show breadcrumbs on root/home page + image: true # Show image or title text + +# ------------------------------------------ +# Default values for site (site.) +# ------------------------------------------ +title: + en: "Test Project" + tc: "測試項目" + sc: "测试项目" + + + +# ------------------------------------------ +# Default values for pages and posts +# ------------------------------------------ +defaults: + - scope: + path: "" # All pages + values: + lang: "en" + layout: "page" + html-lang: "en" + - scope: + path: "tc" + values: + lang: "tc" + html-lang: "zh-Hant" + - scope: + path: "sc" + values: + lang: "sc" + html-lang: "zh-Hans" + + # ------------------------------------------ + # Settings for post types + # ------------------------------------------ + \ No newline at end of file diff --git a/_layouts/default.html b/_layouts/default.html new file mode 100644 index 0000000..77185c5 --- /dev/null +++ b/_layouts/default.html @@ -0,0 +1,43 @@ + + + + + + + + {{ site.title[page.lang] }} - {{ page.title }} + + + + + + + + + + + + + + + + + +
+ Skip to content + {{ content }} +
+ + + + + + + + + \ No newline at end of file diff --git a/_plugins/breadcrumbs.rb b/_plugins/breadcrumbs.rb new file mode 100644 index 0000000..1c70bea --- /dev/null +++ b/_plugins/breadcrumbs.rb @@ -0,0 +1,82 @@ +require_relative 'drops/breadcrumb_item.rb' + +module Jekyll + module Breadcrumbs + @@config = {} + @@siteAddress = "" + @@sideAddresses = {} + + def self.clearAddressCache + @@sideAddresses = {} + end + + def self.loadAddressCache(site) + clearAddressCache + site.documents.each { |page| addAddressItem(page.url, page['crumbtitle'] || page['title'] || '') } # collection files including posts + site.pages.each { |page| addAddressItem(page.url, page['crumbtitle'] || page['title'] || '') } # pages + site.posts.docs.each { |page| addAddressItem(page.url, page['crumbtitle'] || page['title'] || '') } # posts + end + + def self.addAddressItem(url, title) + key = createAddressCacheKey(url) + @@sideAddresses[key] = {:url => url, :title => title} + end + + def self.findAddressItem(path) + key = createAddressCacheKey(path) + @@sideAddresses[key] if key + end + + def self.createAddressCacheKey(path) + path.chomp("/").empty? ? "/" : path.chomp("/") + end + + def self.buildSideBreadcrumbs(side, payload) + payload["breadcrumbs"] = [] + return if side.url == @@siteAddress && root_hide === true + + drop = Jekyll::Drops::BreadcrumbItem + position = 0 + + path = side.url.chomp("/").split(/(?=\/)/) + -1.upto(path.size - 1) do |int| + joined_path = int == -1 ? "" : path[0..int].join + item = findAddressItem(joined_path) + if item + position += 1 + item[:position] = position + item[:root_image] = root_image + payload["breadcrumbs"] << drop.new(item) + end + end + end + + # Config + def self.loadConfig(site) + config = site.config["breadcrumbs"] || {"root" => {"hide" => false, "image" => false}} + root = config["root"] + @@config[:root_hide] = root["hide"] || false + @@config[:root_image] = root["image"] || false + + @@siteAddress = site.config["baseurl"] || "/" + @@siteAddress = "/" if @@siteAddress.empty? + end + + def self.root_hide + @@config[:root_hide] + end + + def self.root_image + @@config[:root_image] + end + end +end + +Jekyll::Hooks.register :site, :pre_render do |site, payload| + Jekyll::Breadcrumbs::loadConfig(site) + Jekyll::Breadcrumbs::loadAddressCache(site) +end + +Jekyll::Hooks.register [:pages, :documents], :pre_render do |side, payload| + Jekyll::Breadcrumbs::buildSideBreadcrumbs(side, payload) +end diff --git a/_plugins/drops/breadcrumb_item.rb b/_plugins/drops/breadcrumb_item.rb new file mode 100644 index 0000000..8e3b2cf --- /dev/null +++ b/_plugins/drops/breadcrumb_item.rb @@ -0,0 +1,29 @@ +module Jekyll + module Drops + class BreadcrumbItem < Liquid::Drop + extend Forwardable + + def initialize(side) + @side = side + end + + def position + @side[:position] + end + + def title + @side[:title] + end + + def url + @side[:url] + end + + def rootimage + @side[:root_image] + end + + end + end + end + \ No newline at end of file diff --git a/_plugins/file_filters.rb b/_plugins/file_filters.rb new file mode 100644 index 0000000..bedbfb6 --- /dev/null +++ b/_plugins/file_filters.rb @@ -0,0 +1,9 @@ +module Jekyll + module FileFilters + def file_mtime(input_url) + File.mtime(input_url) + end + end +end + +Liquid::Template.register_filter(Jekyll::FileFilters) \ No newline at end of file diff --git a/_plugins/relative_path_filters.rb b/_plugins/relative_path_filters.rb new file mode 100644 index 0000000..9edd556 --- /dev/null +++ b/_plugins/relative_path_filters.rb @@ -0,0 +1,81 @@ +module Jekyll + module RelativePathFilter + def to_relative_path(input_url) + site = @context.registers[:site] + page = @context.registers[:page] + + relative_filter_config = site.config["RelativePathFilter"] || {} + enable_this_filter = relative_filter_config["enabled"] + + unless enable_this_filter + # Use Jekyll's to_relative_path for absolute paths, leave relative paths as-is + if input_url.start_with?('/') + return relative_url(input_url) + else + input_url + end + end + + # Use our custom logic for all URLs + + # Check if this is an index page + is_index_page = page['name'].start_with?('index.') + from_path = page['url'] + + # If it's an page file and Page URL end with slash (pretty permalink), + # Make the path to include 'index.html' for correct relative path calculation + if is_index_page && from_path.end_with?('/') + from_path = from_path + 'index.html' + end + + # If the input_url is a directory (ends with '/'), append 'index.html' too + if input_url.end_with?('/') + input_url = input_url + 'index.html' + end + + if input_url.start_with?('/') + calculate_relative_path(from_path, input_url) + else + input_url + end + + end + + private + + def calculate_relative_path(from_path, to_path) + # Normalize the from_path + from_path = "/" + from_path unless from_path.start_with?('/') + + # Handle directory indexes (trailing slashes) + if from_path.end_with?('/') + from_dir = from_path + else + from_dir = File.dirname(from_path) + end + + # Ensure from_dir ends with '/' for consistent processing + from_dir += '/' unless from_dir.end_with?('/') + + # Count directory levels + if from_dir == '/' || from_dir == './' + up_levels = 0 + else + clean_dir = from_dir.gsub(/^\//, '').gsub(/\/$/, '') + up_levels = clean_dir.split('/').size + end + + # Remove leading slash from target + to_path = to_path[1..-1] if to_path.start_with?('/') + + # Build the path + if up_levels == 0 + to_path + else + '../' * up_levels + to_path + end + end + end +end + +Liquid::Template.register_filter(Jekyll::RelativePathFilter) \ No newline at end of file diff --git a/_plugins/string_filters.rb b/_plugins/string_filters.rb new file mode 100644 index 0000000..1264ab9 --- /dev/null +++ b/_plugins/string_filters.rb @@ -0,0 +1,9 @@ +module Jekyll + module StringFilter + def endswith(text, query) + return text.end_with? query + end + end +end + +Liquid::Template.register_filter(Jekyll::StringFilter) \ No newline at end of file diff --git a/_sass/_bootstrap-selective.sass b/_sass/_bootstrap-selective.sass new file mode 100644 index 0000000..1a8cd62 --- /dev/null +++ b/_sass/_bootstrap-selective.sass @@ -0,0 +1,61 @@ +// Configure Bootstrap with your custom variables + +// Use @import for Bootstrap (works reliably with Jekyll) +@import "bootstrap5/functions" + +@import "bootstrap5/variables" +@import "bootstrap5/variables-dark" + +// Override Bootstrap variables here or in a separate file +@import "custom-variables" + +@import "bootstrap5/maps" +@import "bootstrap5/mixins" +@import "bootstrap5/utilities" + +// Import ONLY the Bootstrap components you need +// ===== CORE REQUIRED COMPONENTS ===== +@import "bootstrap5/root" +@import "bootstrap5/reboot" + +// ===== LAYOUT & CONTENT ===== +@import "bootstrap5/containers" +@import "bootstrap5/grid" +@import "bootstrap5/images" +@import "bootstrap5/tables" +@import "bootstrap5/type" + +// ===== FORM COMPONENTS ===== +// @import "bootstrap5/forms" +@import "bootstrap5/buttons" +// @import "bootstrap5/button-group" + +// ===== COMPONENTS USED ===== +// @import "bootstrap5/accordion" +// @import "bootstrap5/alert" +// @import "bootstrap5/badge" +// @import "bootstrap5/breadcrumb" +@import "bootstrap5/card" +// @import "bootstrap5/close" +// @import "bootstrap5/list-group" +// @import "bootstrap5/nav" +// @import "bootstrap5/navbar" +// @import "bootstrap5/pagination" +// @import "bootstrap5/progress" +// @import "bootstrap5/toasts" + +// ===== INTERACTIVE COMPONENTS ===== +// @import "bootstrap5/carousel" +// @import "bootstrap5/dropdown" +// @import "bootstrap5/modal" +// @import "bootstrap5/offcanvas" +// @import "bootstrap5/placeholders" +// @import "bootstrap5/popover" +// @import "bootstrap5/spinners" +// @import "bootstrap5/tooltip" +// @import "bootstrap5/transitions" + +// ===== HELPERS & UTILITIES ===== +@import "bootstrap5/helpers" +@import "bootstrap5/utilities" +@import "bootstrap5/utilities/api" diff --git a/_sass/_custom-variables.sass b/_sass/_custom-variables.sass new file mode 100644 index 0000000..1af5dc0 --- /dev/null +++ b/_sass/_custom-variables.sass @@ -0,0 +1,16 @@ +@use "sass:color" +@use "sass:map" + +$my-theme-colors: ( + "primary": #0000ff, + "secondary": #ffff00, + "success": #00ff00, + "info": #00ffff, + "warning": orange, + "danger": red, + "light": #acacac, + "dark": #444444 +) + +// Merge custom color map with Bootstrap's default theme colors +$theme-colors: map.merge($theme-colors, $my-theme-colors) diff --git a/_sass/_my-project-components.sass b/_sass/_my-project-components.sass new file mode 100644 index 0000000..0d30714 --- /dev/null +++ b/_sass/_my-project-components.sass @@ -0,0 +1,2 @@ +// Create custom component styles here +@use "sass:map" \ No newline at end of file diff --git a/_sass/_my-project-styles.sass b/_sass/_my-project-styles.sass new file mode 100644 index 0000000..d9dfc8d --- /dev/null +++ b/_sass/_my-project-styles.sass @@ -0,0 +1,7 @@ +@use "sass:color" +@use "sass:map" + +$test-color: #65AA21 + +h1 + color: $test-color diff --git a/_sass/bootstrap5/_accordion.scss b/_sass/bootstrap5/_accordion.scss new file mode 100644 index 0000000..e9f267f --- /dev/null +++ b/_sass/bootstrap5/_accordion.scss @@ -0,0 +1,153 @@ +// +// Base styles +// + +.accordion { + // scss-docs-start accordion-css-vars + --#{$prefix}accordion-color: #{$accordion-color}; + --#{$prefix}accordion-bg: #{$accordion-bg}; + --#{$prefix}accordion-transition: #{$accordion-transition}; + --#{$prefix}accordion-border-color: #{$accordion-border-color}; + --#{$prefix}accordion-border-width: #{$accordion-border-width}; + --#{$prefix}accordion-border-radius: #{$accordion-border-radius}; + --#{$prefix}accordion-inner-border-radius: #{$accordion-inner-border-radius}; + --#{$prefix}accordion-btn-padding-x: #{$accordion-button-padding-x}; + --#{$prefix}accordion-btn-padding-y: #{$accordion-button-padding-y}; + --#{$prefix}accordion-btn-color: #{$accordion-button-color}; + --#{$prefix}accordion-btn-bg: #{$accordion-button-bg}; + --#{$prefix}accordion-btn-icon: #{escape-svg($accordion-button-icon)}; + --#{$prefix}accordion-btn-icon-width: #{$accordion-icon-width}; + --#{$prefix}accordion-btn-icon-transform: #{$accordion-icon-transform}; + --#{$prefix}accordion-btn-icon-transition: #{$accordion-icon-transition}; + --#{$prefix}accordion-btn-active-icon: #{escape-svg($accordion-button-active-icon)}; + --#{$prefix}accordion-btn-focus-box-shadow: #{$accordion-button-focus-box-shadow}; + --#{$prefix}accordion-body-padding-x: #{$accordion-body-padding-x}; + --#{$prefix}accordion-body-padding-y: #{$accordion-body-padding-y}; + --#{$prefix}accordion-active-color: #{$accordion-button-active-color}; + --#{$prefix}accordion-active-bg: #{$accordion-button-active-bg}; + // scss-docs-end accordion-css-vars +} + +.accordion-button { + position: relative; + display: flex; + align-items: center; + width: 100%; + padding: var(--#{$prefix}accordion-btn-padding-y) var(--#{$prefix}accordion-btn-padding-x); + @include font-size($font-size-base); + color: var(--#{$prefix}accordion-btn-color); + text-align: left; // Reset button style + background-color: var(--#{$prefix}accordion-btn-bg); + border: 0; + @include border-radius(0); + overflow-anchor: none; + @include transition(var(--#{$prefix}accordion-transition)); + + &:not(.collapsed) { + color: var(--#{$prefix}accordion-active-color); + background-color: var(--#{$prefix}accordion-active-bg); + box-shadow: inset 0 calc(-1 * var(--#{$prefix}accordion-border-width)) 0 var(--#{$prefix}accordion-border-color); // stylelint-disable-line function-disallowed-list + + &::after { + background-image: var(--#{$prefix}accordion-btn-active-icon); + transform: var(--#{$prefix}accordion-btn-icon-transform); + } + } + + // Accordion icon + &::after { + flex-shrink: 0; + width: var(--#{$prefix}accordion-btn-icon-width); + height: var(--#{$prefix}accordion-btn-icon-width); + margin-left: auto; + content: ""; + background-image: var(--#{$prefix}accordion-btn-icon); + background-repeat: no-repeat; + background-size: var(--#{$prefix}accordion-btn-icon-width); + @include transition(var(--#{$prefix}accordion-btn-icon-transition)); + } + + &:hover { + z-index: 2; + } + + &:focus { + z-index: 3; + outline: 0; + box-shadow: var(--#{$prefix}accordion-btn-focus-box-shadow); + } +} + +.accordion-header { + margin-bottom: 0; +} + +.accordion-item { + color: var(--#{$prefix}accordion-color); + background-color: var(--#{$prefix}accordion-bg); + border: var(--#{$prefix}accordion-border-width) solid var(--#{$prefix}accordion-border-color); + + &:first-of-type { + @include border-top-radius(var(--#{$prefix}accordion-border-radius)); + + > .accordion-header .accordion-button { + @include border-top-radius(var(--#{$prefix}accordion-inner-border-radius)); + } + } + + &:not(:first-of-type) { + border-top: 0; + } + + // Only set a border-radius on the last item if the accordion is collapsed + &:last-of-type { + @include border-bottom-radius(var(--#{$prefix}accordion-border-radius)); + + > .accordion-header .accordion-button { + &.collapsed { + @include border-bottom-radius(var(--#{$prefix}accordion-inner-border-radius)); + } + } + + > .accordion-collapse { + @include border-bottom-radius(var(--#{$prefix}accordion-border-radius)); + } + } +} + +.accordion-body { + padding: var(--#{$prefix}accordion-body-padding-y) var(--#{$prefix}accordion-body-padding-x); +} + + +// Flush accordion items +// +// Remove borders and border-radius to keep accordion items edge-to-edge. + +.accordion-flush { + > .accordion-item { + border-right: 0; + border-left: 0; + @include border-radius(0); + + &:first-child { border-top: 0; } + &:last-child { border-bottom: 0; } + + // stylelint-disable selector-max-class + > .accordion-collapse, + > .accordion-header .accordion-button, + > .accordion-header .accordion-button.collapsed { + @include border-radius(0); + } + // stylelint-enable selector-max-class + } +} + +@if $enable-dark-mode { + @include color-mode(dark) { + .accordion-button::after { + --#{$prefix}accordion-btn-icon: #{escape-svg($accordion-button-icon-dark)}; + --#{$prefix}accordion-btn-active-icon: #{escape-svg($accordion-button-active-icon-dark)}; + } + } +} diff --git a/_sass/bootstrap5/_alert.scss b/_sass/bootstrap5/_alert.scss new file mode 100644 index 0000000..b8cff9b --- /dev/null +++ b/_sass/bootstrap5/_alert.scss @@ -0,0 +1,68 @@ +// +// Base styles +// + +.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: 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 +.alert-heading { + // Specified to prevent conflicts of changing $headings-color + color: inherit; +} + +// Provide class for links that match alerts +.alert-link { + font-weight: $alert-link-font-weight; + color: var(--#{$prefix}alert-link-color); +} + + +// Dismissible alerts +// +// Expand the right padding and account for the close button's positioning. + +.alert-dismissible { + padding-right: $alert-dismissible-padding-r; + + // Adjust close link position + .btn-close { + position: absolute; + top: 0; + right: 0; + z-index: $stretched-link-z-index + 1; + padding: $alert-padding-y * 1.25 $alert-padding-x; + } +} + + +// scss-docs-start alert-modifiers +// Generate contextual modifier classes for colorizing the alert +@each $state in map-keys($theme-colors) { + .alert-#{$state} { + --#{$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/_sass/bootstrap5/_badge.scss b/_sass/bootstrap5/_badge.scss new file mode 100644 index 0000000..cc3d269 --- /dev/null +++ b/_sass/bootstrap5/_badge.scss @@ -0,0 +1,38 @@ +// Base class +// +// Requires one of the contextual, color modifier classes for `color` and +// `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: 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: var(--#{$prefix}badge-color); + text-align: center; + white-space: nowrap; + vertical-align: baseline; + @include border-radius(var(--#{$prefix}badge-border-radius)); + @include gradient-bg(); + + // Empty badges collapse automatically + &:empty { + display: none; + } +} + +// Quick fix for badges in buttons +.btn .badge { + position: relative; + top: -1px; +} diff --git a/_sass/bootstrap5/_breadcrumb.scss b/_sass/bootstrap5/_breadcrumb.scss new file mode 100644 index 0000000..b8252ff --- /dev/null +++ b/_sass/bootstrap5/_breadcrumb.scss @@ -0,0 +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: 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: 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: var(--#{$prefix}breadcrumb-item-padding-x); + + &::before { + float: left; // Suppress inline spacings and underlining of the separator + 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: var(--#{$prefix}breadcrumb-item-active-color); + } +} diff --git a/_sass/bootstrap5/_button-group.scss b/_sass/bootstrap5/_button-group.scss new file mode 100644 index 0000000..78e1252 --- /dev/null +++ b/_sass/bootstrap5/_button-group.scss @@ -0,0 +1,147 @@ +// Make the div behave like a button +.btn-group, +.btn-group-vertical { + position: relative; + display: inline-flex; + vertical-align: middle; // match .btn alignment given font-size hack above + + > .btn { + position: relative; + flex: 1 1 auto; + } + + // Bring the hover, focused, and "active" buttons to the front to overlay + // the borders properly + > .btn-check:checked + .btn, + > .btn-check:focus + .btn, + > .btn:hover, + > .btn:focus, + > .btn:active, + > .btn.active { + z-index: 1; + } +} + +// Optional: Group multiple button groups together for a toolbar +.btn-toolbar { + display: flex; + flex-wrap: wrap; + justify-content: flex-start; + + .input-group { + width: auto; + } +} + +.btn-group { + @include border-radius($btn-border-radius); + + // Prevent double borders when buttons are next to each other + > :not(.btn-check:first-child) + .btn, + > .btn-group:not(:first-child) { + margin-left: calc(-1 * #{$btn-border-width}); // 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); + } + + // The left radius should be 0 if the button is: + // - the "third or more" child + // - the second child and the previous element isn't `.btn-check` (making it the first child visually) + // - part of a btn-group which isn't the first child + > .btn:nth-child(n + 3), + > :not(.btn-check) + .btn, + > .btn-group:not(:first-child) > .btn { + @include border-start-radius(0); + } +} + +// Sizing +// +// Remix the default button sizing classes into new ones for easier manipulation. + +.btn-group-sm > .btn { @extend .btn-sm; } +.btn-group-lg > .btn { @extend .btn-lg; } + + +// +// Split button dropdowns +// + +.dropdown-toggle-split { + padding-right: $btn-padding-x * .75; + padding-left: $btn-padding-x * .75; + + &::after, + .dropup &::after, + .dropend &::after { + margin-left: 0; + } + + .dropstart &::before { + margin-right: 0; + } +} + +.btn-sm + .dropdown-toggle-split { + padding-right: $btn-padding-x-sm * .75; + padding-left: $btn-padding-x-sm * .75; +} + +.btn-lg + .dropdown-toggle-split { + padding-right: $btn-padding-x-lg * .75; + padding-left: $btn-padding-x-lg * .75; +} + + +// The clickable button for toggling the menu +// Set the same inset shadow as the :active state +.btn-group.show .dropdown-toggle { + @include box-shadow($btn-active-box-shadow); + + // Show no shadow for `.btn-link` since it has no other button styles. + &.btn-link { + @include box-shadow(none); + } +} + + +// +// Vertical button groups +// + +.btn-group-vertical { + flex-direction: column; + align-items: flex-start; + justify-content: center; + + > .btn, + > .btn-group { + width: 100%; + } + + > .btn:not(:first-child), + > .btn-group:not(:first-child) { + margin-top: calc(-1 * #{$btn-border-width}); // stylelint-disable-line function-disallowed-list + } + + // Reset rounded corners + > .btn:not(:last-child):not(.dropdown-toggle), + > .btn-group:not(:last-child) > .btn { + @include border-bottom-radius(0); + } + + // The top radius should be 0 if the button is: + // - the "third or more" child + // - the second child and the previous element isn't `.btn-check` (making it the first child visually) + // - part of a btn-group which isn't the first child + > .btn:nth-child(n + 3), + > :not(.btn-check) + .btn, + > .btn-group:not(:first-child) > .btn { + @include border-top-radius(0); + } +} diff --git a/_sass/bootstrap5/_buttons.scss b/_sass/bootstrap5/_buttons.scss new file mode 100644 index 0000000..caa4518 --- /dev/null +++ b/_sass/bootstrap5/_buttons.scss @@ -0,0 +1,216 @@ +// +// Base styles +// + +.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; + 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; + 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: 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 + &: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; + // 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 + &, + :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-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); + } + } + } + + .btn-check:checked: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; + 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); + } +} + + +// +// Alternate buttons +// + +// scss-docs-start btn-variant-loops +@each $color, $value in $theme-colors { + .btn-#{$color} { + @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); + } + } +} + +@each $color, $value in $theme-colors { + .btn-outline-#{$color} { + @include button-outline-variant($value); + } +} +// scss-docs-end btn-variant-loops + + +// +// Link buttons +// + +// Make a button look and behave like a link +.btn-link { + --#{$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: var(--#{$prefix}btn-hover-color); + } + + // No need for an active state here +} + + +// +// Button Sizes +// + +.btn-lg { + @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $btn-font-size-lg, $btn-border-radius-lg); +} + +.btn-sm { + @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $btn-font-size-sm, $btn-border-radius-sm); +} diff --git a/_sass/bootstrap5/_card.scss b/_sass/bootstrap5/_card.scss new file mode 100644 index 0000000..dcebe6a --- /dev/null +++ b/_sass/bootstrap5/_card.scss @@ -0,0 +1,238 @@ +// +// Base styles +// + +.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: var(--#{$prefix}card-height); + color: var(--#{$prefix}body-color); + word-wrap: break-word; + background-color: var(--#{$prefix}card-bg); + background-clip: border-box; + 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; + margin-left: 0; + } + + > .list-group { + border-top: inherit; + border-bottom: inherit; + + &:first-child { + border-top-width: 0; + @include border-top-radius(var(--#{$prefix}card-inner-border-radius)); + } + + &:last-child { + border-bottom-width: 0; + @include border-bottom-radius(var(--#{$prefix}card-inner-border-radius)); + } + } + + // Due to specificity of the above selector (`.card > .list-group`), we must + // use a child selector here to prevent double borders. + > .card-header + .list-group, + > .list-group + .card-footer { + border-top: 0; + } +} + +.card-body { + // 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: var(--#{$prefix}card-spacer-y) var(--#{$prefix}card-spacer-x); + color: var(--#{$prefix}card-color); +} + +.card-title { + margin-bottom: var(--#{$prefix}card-title-spacer-y); + color: var(--#{$prefix}card-title-color); +} + +.card-subtitle { + 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 { + margin-bottom: 0; +} + +.card-link { + &:hover { + text-decoration: if($link-hover-decoration == underline, none, null); + } + + + .card-link { + margin-left: var(--#{$prefix}card-spacer-x); + } +} + +// +// Optional textual caps +// + +.card-header { + padding: var(--#{$prefix}card-cap-padding-y) var(--#{$prefix}card-cap-padding-x); + margin-bottom: 0; // Removes the default margin-bottom of + 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(var(--#{$prefix}card-inner-border-radius) var(--#{$prefix}card-inner-border-radius) 0 0); + } +} + +.card-footer { + 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 var(--#{$prefix}card-inner-border-radius) var(--#{$prefix}card-inner-border-radius)); + } +} + + +// +// Header navs +// + +.card-header-tabs { + 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; + + .nav-link.active { + background-color: var(--#{$prefix}card-bg); + border-bottom-color: var(--#{$prefix}card-bg); + } +} + +.card-header-pills { + 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 +.card-img-overlay { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + padding: var(--#{$prefix}card-img-overlay-padding); + @include border-radius(var(--#{$prefix}card-inner-border-radius)); +} + +.card-img, +.card-img-top, +.card-img-bottom { + width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch +} + +.card-img, +.card-img-top { + @include border-top-radius(var(--#{$prefix}card-inner-border-radius)); +} + +.card-img, +.card-img-bottom { + @include border-bottom-radius(var(--#{$prefix}card-inner-border-radius)); +} + + +// +// Card groups +// + +.card-group { + // The child selector allows nested `.card` within `.card-group` + // to display properly. + > .card { + margin-bottom: var(--#{$prefix}card-group-margin); + } + + @include media-breakpoint-up(sm) { + display: flex; + flex-flow: row wrap; + // The child selector allows nested `.card` within `.card-group` + // to display properly. + > .card { + flex: 1 0 0; + margin-bottom: 0; + + + .card { + margin-left: 0; + border-left: 0; + } + + // Handle rounded corners + @if $enable-rounded { + &:not(:last-child) { + @include border-end-radius(0); + + > .card-img-top, + > .card-header { + // stylelint-disable-next-line property-disallowed-list + border-top-right-radius: 0; + } + > .card-img-bottom, + > .card-footer { + // stylelint-disable-next-line property-disallowed-list + border-bottom-right-radius: 0; + } + } + + &:not(:first-child) { + @include border-start-radius(0); + + > .card-img-top, + > .card-header { + // stylelint-disable-next-line property-disallowed-list + border-top-left-radius: 0; + } + > .card-img-bottom, + > .card-footer { + // stylelint-disable-next-line property-disallowed-list + border-bottom-left-radius: 0; + } + } + } + } + } +} diff --git a/_sass/bootstrap5/_carousel.scss b/_sass/bootstrap5/_carousel.scss new file mode 100644 index 0000000..5ebf6b1 --- /dev/null +++ b/_sass/bootstrap5/_carousel.scss @@ -0,0 +1,226 @@ +// Notes on the classes: +// +// 1. .carousel.pointer-event should ideally be pan-y (to allow for users to scroll vertically) +// even when their scroll action started on a carousel, but for compatibility (with Firefox) +// we're preventing all actions instead +// 2. The .carousel-item-start and .carousel-item-end is used to indicate where +// the active slide is heading. +// 3. .active.carousel-item is the current slide. +// 4. .active.carousel-item-start and .active.carousel-item-end is the current +// slide in its in-transition state. Only one of these occurs at a time. +// 5. .carousel-item-next.carousel-item-start and .carousel-item-prev.carousel-item-end +// is the upcoming slide in transition. + +.carousel { + position: relative; +} + +.carousel.pointer-event { + touch-action: pan-y; +} + +.carousel-inner { + position: relative; + width: 100%; + overflow: hidden; + @include clearfix(); +} + +.carousel-item { + position: relative; + display: none; + float: left; + width: 100%; + margin-right: -100%; + backface-visibility: hidden; + @include transition($carousel-transition); +} + +.carousel-item.active, +.carousel-item-next, +.carousel-item-prev { + display: block; +} + +.carousel-item-next:not(.carousel-item-start), +.active.carousel-item-end { + transform: translateX(100%); +} + +.carousel-item-prev:not(.carousel-item-end), +.active.carousel-item-start { + transform: translateX(-100%); +} + + +// +// Alternate transitions +// + +.carousel-fade { + .carousel-item { + opacity: 0; + transition-property: opacity; + transform: none; + } + + .carousel-item.active, + .carousel-item-next.carousel-item-start, + .carousel-item-prev.carousel-item-end { + z-index: 1; + opacity: 1; + } + + .active.carousel-item-start, + .active.carousel-item-end { + z-index: 0; + opacity: 0; + @include transition(opacity 0s $carousel-transition-duration); + } +} + + +// +// Left/right controls for nav +// + +.carousel-control-prev, +.carousel-control-next { + position: absolute; + top: 0; + bottom: 0; + z-index: 1; + // Use flex for alignment (1-3) + display: flex; // 1. allow flex styles + align-items: center; // 2. vertically center contents + justify-content: center; // 3. horizontally center contents + width: $carousel-control-width; + padding: 0; + color: $carousel-control-color; + text-align: center; + background: none; + filter: var(--#{$prefix}carousel-control-icon-filter); + border: 0; + opacity: $carousel-control-opacity; + @include transition($carousel-control-transition); + + // Hover/focus state + &:hover, + &:focus { + color: $carousel-control-color; + text-decoration: none; + outline: 0; + opacity: $carousel-control-hover-opacity; + } +} +.carousel-control-prev { + left: 0; + background-image: if($enable-gradients, linear-gradient(90deg, rgba($black, .25), rgba($black, .001)), null); +} +.carousel-control-next { + right: 0; + background-image: if($enable-gradients, linear-gradient(270deg, rgba($black, .25), rgba($black, .001)), null); +} + +// Icons for within +.carousel-control-prev-icon, +.carousel-control-next-icon { + display: inline-block; + width: $carousel-control-icon-width; + height: $carousel-control-icon-width; + background-repeat: no-repeat; + background-position: 50%; + background-size: 100% 100%; +} + +.carousel-control-prev-icon { + background-image: escape-svg($carousel-control-prev-icon-bg) #{"/*rtl:" + escape-svg($carousel-control-next-icon-bg) + "*/"}; +} +.carousel-control-next-icon { + background-image: escape-svg($carousel-control-next-icon-bg) #{"/*rtl:" + escape-svg($carousel-control-prev-icon-bg) + "*/"}; +} + +// Optional indicator pips/controls +// +// Add a container (such as a list) with the following class and add an item (ideally a focusable control, +// like a button) with data-bs-target for each slide your carousel holds. + +.carousel-indicators { + position: absolute; + right: 0; + bottom: 0; + left: 0; + z-index: 2; + display: flex; + justify-content: center; + padding: 0; + // Use the .carousel-control's width as margin so we don't overlay those + margin-right: $carousel-control-width; + margin-bottom: 1rem; + margin-left: $carousel-control-width; + + [data-bs-target] { + box-sizing: content-box; + flex: 0 1 auto; + width: $carousel-indicator-width; + height: $carousel-indicator-height; + padding: 0; + margin-right: $carousel-indicator-spacer; + margin-left: $carousel-indicator-spacer; + text-indent: -999px; + cursor: pointer; + background-color: var(--#{$prefix}carousel-indicator-active-bg); + background-clip: padding-box; + border: 0; + // Use transparent borders to increase the hit area by 10px on top and bottom. + border-top: $carousel-indicator-hit-area-height solid transparent; + border-bottom: $carousel-indicator-hit-area-height solid transparent; + opacity: $carousel-indicator-opacity; + @include transition($carousel-indicator-transition); + } + + .active { + opacity: $carousel-indicator-active-opacity; + } +} + + +// Optional captions +// +// + +.carousel-caption { + position: absolute; + right: (100% - $carousel-caption-width) * .5; + bottom: $carousel-caption-spacer; + left: (100% - $carousel-caption-width) * .5; + padding-top: $carousel-caption-padding-y; + padding-bottom: $carousel-caption-padding-y; + color: var(--#{$prefix}carousel-caption-color); + text-align: center; +} + +// Dark mode carousel + +@mixin carousel-dark() { + --#{$prefix}carousel-indicator-active-bg: #{$carousel-indicator-active-bg-dark}; + --#{$prefix}carousel-caption-color: #{$carousel-caption-color-dark}; + --#{$prefix}carousel-control-icon-filter: #{$carousel-control-icon-filter-dark}; +} + +.carousel-dark { + @include carousel-dark(); +} + +:root, +[data-bs-theme="light"] { + --#{$prefix}carousel-indicator-active-bg: #{$carousel-indicator-active-bg}; + --#{$prefix}carousel-caption-color: #{$carousel-caption-color}; + --#{$prefix}carousel-control-icon-filter: #{$carousel-control-icon-filter}; +} + +@if $enable-dark-mode { + @include color-mode(dark, true) { + @include carousel-dark(); + } +} diff --git a/_sass/bootstrap5/_close.scss b/_sass/bootstrap5/_close.scss new file mode 100644 index 0000000..d53c96f --- /dev/null +++ b/_sass/bootstrap5/_close.scss @@ -0,0 +1,66 @@ +// 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}; + // 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: var(--#{$prefix}btn-close-color); + background: transparent var(--#{$prefix}btn-close-bg) center / $btn-close-width auto no-repeat; // include transparent for button elements + filter: var(--#{$prefix}btn-close-filter); + border: 0; // for button elements + @include border-radius(); + opacity: var(--#{$prefix}btn-close-opacity); + + // Override 's hover style + &:hover { + color: var(--#{$prefix}btn-close-color); + text-decoration: none; + opacity: var(--#{$prefix}btn-close-hover-opacity); + } + + &:focus { + outline: 0; + box-shadow: var(--#{$prefix}btn-close-focus-shadow); + opacity: var(--#{$prefix}btn-close-focus-opacity); + } + + &:disabled, + &.disabled { + pointer-events: none; + user-select: none; + opacity: var(--#{$prefix}btn-close-disabled-opacity); + } +} + +@mixin btn-close-white() { + --#{$prefix}btn-close-filter: #{$btn-close-filter-dark}; +} + +.btn-close-white { + @include btn-close-white(); +} + +:root, +[data-bs-theme="light"] { + --#{$prefix}btn-close-filter: #{$btn-close-filter}; +} + +@if $enable-dark-mode { + @include color-mode(dark, true) { + @include btn-close-white(); + } +} diff --git a/_sass/bootstrap5/_containers.scss b/_sass/bootstrap5/_containers.scss new file mode 100644 index 0000000..83b3138 --- /dev/null +++ b/_sass/bootstrap5/_containers.scss @@ -0,0 +1,41 @@ +// Container widths +// +// Set the container width, and override it for fixed navbars in media queries. + +@if $enable-container-classes { + // Single container class with breakpoint max-widths + .container, + // 100% wide container at all breakpoints + .container-fluid { + @include make-container(); + } + + // Responsive containers that are 100% wide until a breakpoint + @each $breakpoint, $container-max-width in $container-max-widths { + .container-#{$breakpoint} { + @extend .container-fluid; + } + + @include media-breakpoint-up($breakpoint, $grid-breakpoints) { + %responsive-container-#{$breakpoint} { + max-width: $container-max-width; + } + + // Extend each breakpoint which is smaller or equal to the current breakpoint + $extend-breakpoint: true; + + @each $name, $width in $grid-breakpoints { + @if ($extend-breakpoint) { + .container#{breakpoint-infix($name, $grid-breakpoints)} { + @extend %responsive-container-#{$breakpoint}; + } + + // Once the current breakpoint is reached, stop extending + @if ($breakpoint == $name) { + $extend-breakpoint: false; + } + } + } + } + } +} diff --git a/_sass/bootstrap5/_dropdown.scss b/_sass/bootstrap5/_dropdown.scss new file mode 100644 index 0000000..587ebb4 --- /dev/null +++ b/_sass/bootstrap5/_dropdown.scss @@ -0,0 +1,250 @@ +// The dropdown wrapper (`
`) +.dropup, +.dropend, +.dropdown, +.dropstart, +.dropup-center, +.dropdown-center { + position: relative; +} + +.dropdown-toggle { + white-space: nowrap; + + // Generate the caret automatically + @include caret(); +} + +// The dropdown menu +.dropdown-menu { + // scss-docs-start dropdown-css-vars + --#{$prefix}dropdown-zindex: #{$zindex-dropdown}; + --#{$prefix}dropdown-min-width: #{$dropdown-min-width}; + --#{$prefix}dropdown-padding-x: #{$dropdown-padding-x}; + --#{$prefix}dropdown-padding-y: #{$dropdown-padding-y}; + --#{$prefix}dropdown-spacer: #{$dropdown-spacer}; + @include rfs($dropdown-font-size, --#{$prefix}dropdown-font-size); + --#{$prefix}dropdown-color: #{$dropdown-color}; + --#{$prefix}dropdown-bg: #{$dropdown-bg}; + --#{$prefix}dropdown-border-color: #{$dropdown-border-color}; + --#{$prefix}dropdown-border-radius: #{$dropdown-border-radius}; + --#{$prefix}dropdown-border-width: #{$dropdown-border-width}; + --#{$prefix}dropdown-inner-border-radius: #{$dropdown-inner-border-radius}; + --#{$prefix}dropdown-divider-bg: #{$dropdown-divider-bg}; + --#{$prefix}dropdown-divider-margin-y: #{$dropdown-divider-margin-y}; + --#{$prefix}dropdown-box-shadow: #{$dropdown-box-shadow}; + --#{$prefix}dropdown-link-color: #{$dropdown-link-color}; + --#{$prefix}dropdown-link-hover-color: #{$dropdown-link-hover-color}; + --#{$prefix}dropdown-link-hover-bg: #{$dropdown-link-hover-bg}; + --#{$prefix}dropdown-link-active-color: #{$dropdown-link-active-color}; + --#{$prefix}dropdown-link-active-bg: #{$dropdown-link-active-bg}; + --#{$prefix}dropdown-link-disabled-color: #{$dropdown-link-disabled-color}; + --#{$prefix}dropdown-item-padding-x: #{$dropdown-item-padding-x}; + --#{$prefix}dropdown-item-padding-y: #{$dropdown-item-padding-y}; + --#{$prefix}dropdown-header-color: #{$dropdown-header-color}; + --#{$prefix}dropdown-header-padding-x: #{$dropdown-header-padding-x}; + --#{$prefix}dropdown-header-padding-y: #{$dropdown-header-padding-y}; + // scss-docs-end dropdown-css-vars + + position: absolute; + z-index: var(--#{$prefix}dropdown-zindex); + display: none; // none by default, but block on "open" of the menu + min-width: var(--#{$prefix}dropdown-min-width); + padding: var(--#{$prefix}dropdown-padding-y) var(--#{$prefix}dropdown-padding-x); + margin: 0; // Override default margin of ul + @include font-size(var(--#{$prefix}dropdown-font-size)); + color: var(--#{$prefix}dropdown-color); + text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer) + list-style: none; + background-color: var(--#{$prefix}dropdown-bg); + background-clip: padding-box; + border: var(--#{$prefix}dropdown-border-width) solid var(--#{$prefix}dropdown-border-color); + @include border-radius(var(--#{$prefix}dropdown-border-radius)); + @include box-shadow(var(--#{$prefix}dropdown-box-shadow)); + + &[data-bs-popper] { + top: 100%; + left: 0; + margin-top: var(--#{$prefix}dropdown-spacer); + } + + @if $dropdown-padding-y == 0 { + > .dropdown-item:first-child, + > li:first-child .dropdown-item { + @include border-top-radius(var(--#{$prefix}dropdown-inner-border-radius)); + } + > .dropdown-item:last-child, + > li:last-child .dropdown-item { + @include border-bottom-radius(var(--#{$prefix}dropdown-inner-border-radius)); + } + + } +} + +// scss-docs-start responsive-breakpoints +// We deliberately hardcode the `bs-` prefix because we check +// this custom property in JS to determine Popper's positioning + +@each $breakpoint in map-keys($grid-breakpoints) { + @include media-breakpoint-up($breakpoint) { + $infix: breakpoint-infix($breakpoint, $grid-breakpoints); + + .dropdown-menu#{$infix}-start { + --bs-position: start; + + &[data-bs-popper] { + right: auto; + left: 0; + } + } + + .dropdown-menu#{$infix}-end { + --bs-position: end; + + &[data-bs-popper] { + right: 0; + left: auto; + } + } + } +} +// scss-docs-end responsive-breakpoints + +// Allow for dropdowns to go bottom up (aka, dropup-menu) +// Just add .dropup after the standard .dropdown class and you're set. +.dropup { + .dropdown-menu[data-bs-popper] { + top: auto; + bottom: 100%; + margin-top: 0; + margin-bottom: var(--#{$prefix}dropdown-spacer); + } + + .dropdown-toggle { + @include caret(up); + } +} + +.dropend { + .dropdown-menu[data-bs-popper] { + top: 0; + right: auto; + left: 100%; + margin-top: 0; + margin-left: var(--#{$prefix}dropdown-spacer); + } + + .dropdown-toggle { + @include caret(end); + &::after { + vertical-align: 0; + } + } +} + +.dropstart { + .dropdown-menu[data-bs-popper] { + top: 0; + right: 100%; + left: auto; + margin-top: 0; + margin-right: var(--#{$prefix}dropdown-spacer); + } + + .dropdown-toggle { + @include caret(start); + &::before { + vertical-align: 0; + } + } +} + + +// Dividers (basically an `
`) within the dropdown +.dropdown-divider { + height: 0; + margin: var(--#{$prefix}dropdown-divider-margin-y) 0; + overflow: hidden; + border-top: 1px solid var(--#{$prefix}dropdown-divider-bg); + opacity: 1; // Revisit in v6 to de-dupe styles that conflict with
element +} + +// Links, buttons, and more within the dropdown menu +// +// `
+ + + + + + + + + +
+ + +
+
+

.text-primary

+

.text-primary-emphasis

+

.text-secondary

+

.text-secondary-emphasis

+

.text-success

+

.text-success-emphasis

+

.text-danger

+

.text-danger-emphasis

+

.text-warning

+

.text-warning-emphasis

+

.text-info

+

.text-info-emphasis

+

.text-light

+

.text-light-emphasis

+

.text-dark

+

.text-dark-emphasis

+ +

.text-body

+

.text-body-emphasis

+

.text-body-secondary

+

.text-body-tertiary

+ +

.text-black

+

.text-white

+

.text-black-50

+

.text-white-50

+
+
\ No newline at end of file