From 8b922b2e8bfdc0557d5cb7327f53ef53fc44af58 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 15 Jan 2025 22:39:20 +1100 Subject: [PATCH] Add select2 bootstrap 5 theme --- package-lock.json | 12 +++++++++- package.json | 3 ++- public/css/fixes.css | 22 +++++++++++++++++++ resources/sass/app.scss | 1 + .../layouts/partials/htmlheader.blade.php | 2 ++ resources/views/layouts/dn.blade.php | 3 ++- 6 files changed, 40 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7a2f0a3..78202a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,8 @@ "resolve-url-loader": "^5.0.0", "sass": "^1.58.3", "sass-loader": "^13.2.0", - "select2": "^4.1.0-rc.0" + "select2": "^4.1.0-rc.0", + "select2-bootstrap-5-theme": "^1.3.0" } }, "node_modules/@ampproject/remapping": { @@ -7644,6 +7645,15 @@ "resolved": "https://registry.npmjs.org/select2/-/select2-4.1.0-rc.0.tgz", "integrity": "sha512-Hr9TdhyHCZUtwznEH2CBf7967mEM0idtJ5nMtjvk3Up5tPukOLXbHUNmh10oRfeNIhj+3GD3niu+g6sVK+gK0A==" }, + "node_modules/select2-bootstrap-5-theme": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/select2-bootstrap-5-theme/-/select2-bootstrap-5-theme-1.3.0.tgz", + "integrity": "sha512-uEJDruP4tmwyKcs3V0oP7CIsyC45PGF5ddo8unwTp8OucJ1PSuTOBr+xbWaHTQPGnvp7N96psVQ5UBMQvFCcHA==", + "license": "MIT", + "dependencies": { + "bootstrap": "^5.1.3" + } + }, "node_modules/selfsigned": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.4.1.tgz", diff --git a/package.json b/package.json index 2d1dca4..3c7d0d7 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "resolve-url-loader": "^5.0.0", "sass": "^1.58.3", "sass-loader": "^13.2.0", - "select2": "^4.1.0-rc.0" + "select2": "^4.1.0-rc.0", + "select2-bootstrap-5-theme": "^1.3.0" } } diff --git a/public/css/fixes.css b/public/css/fixes.css index ea7e78e..2005ad2 100644 --- a/public/css/fixes.css +++ b/public/css/fixes.css @@ -268,4 +268,26 @@ pre code .line::before { opacity: 0.5; display: inline-block; border-right: 1px solid rgba(0, 0, 0, .5); +} + +/** select2 rendering fixes */ +/* The opened input box */ +.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field { + line-height: 1.0; + border: 1px solid #aaa; +} + +.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option { + padding: 0.3rem 0.2rem 0.3rem 0.4rem; + font-size: 95%; +} + +select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__clear, .select2-container--bootstrap-5 .select2-selection--single .select2-selection__clear { + width: 0.5rem; + height: 0.5rem; +} + +.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered .select2-selection__placeholder { + line-height: 1.0; + font-size: 90%; } \ No newline at end of file diff --git a/resources/sass/app.scss b/resources/sass/app.scss index babf6c6..638de65 100644 --- a/resources/sass/app.scss +++ b/resources/sass/app.scss @@ -6,3 +6,4 @@ // Select2 @import "select2/dist/css/select2"; +@import "select2-bootstrap-5-theme/dist/select2-bootstrap-5-theme"; diff --git a/resources/themes/architect/views/layouts/partials/htmlheader.blade.php b/resources/themes/architect/views/layouts/partials/htmlheader.blade.php index 9799816..b6d809b 100644 --- a/resources/themes/architect/views/layouts/partials/htmlheader.blade.php +++ b/resources/themes/architect/views/layouts/partials/htmlheader.blade.php @@ -33,6 +33,8 @@ @endif + + @yield('page-styles') {{-- @if(file_exists('css/print.css')) diff --git a/resources/views/layouts/dn.blade.php b/resources/views/layouts/dn.blade.php index 0adb785..a908cbe 100644 --- a/resources/views/layouts/dn.blade.php +++ b/resources/views/layouts/dn.blade.php @@ -11,4 +11,5 @@ @yield('page-modals') -@yield('page-scripts') \ No newline at end of file +@yield('page-scripts') +@yield('page-styles') \ No newline at end of file