fix(bootstrap): 修复导航主题色补丁(by AI)
This commit is contained in:
parent
b25c8417d1
commit
c31118b810
@ -1,5 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 1.0.9 (2026-06-27)
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
- **Theme Engine**: Extended `Bootstrap.config` color patch coverage to `nav-pills`, `dropdown-menu` active state, and `navbar-nav .nav-link.active` so navigation components follow the configured primary color instead of Bootstrap default blue.
|
||||||
|
|
||||||
## 1.0.6 (2026-06-09)
|
## 1.0.6 (2026-06-09)
|
||||||
|
|
||||||
### Breaking Changes
|
### Breaking Changes
|
||||||
|
|||||||
@ -5,7 +5,7 @@ Bootstrap 5.3 自包含集成引擎。
|
|||||||
## 0. 快速开始 (Quick Start)
|
## 0. 快速开始 (Quick Start)
|
||||||
直接在 HTML 中引入(无需打包,完全非 ESM 注入):
|
直接在 HTML 中引入(无需打包,完全非 ESM 注入):
|
||||||
```html
|
```html
|
||||||
<script src="https://cdn.jsdelivr.net/npm/@apigo.cc/bootstrap@1.0.6/dist/bootstrap.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/@apigo.cc/bootstrap@1.0.9/dist/bootstrap.min.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
## 1. 运行时接口
|
## 1. 运行时接口
|
||||||
@ -44,5 +44,5 @@ Bootstrap.config({ success: '#22c55e' });
|
|||||||
```
|
```
|
||||||
|
|
||||||
## 3. 核心机制 (Internal)
|
## 3. 核心机制 (Internal)
|
||||||
- **运行时样式补丁**: `Bootstrap.config` 动态更新 `id="bs-config-patch"` 的 `<style>` 标签。通过 `!important` 覆盖 Bootstrap 内部硬编码的组件颜色(如 `.btn`, `.form-switch`, `.form-range`, `.progress-bar`, `.list-group-item` 等)。
|
- **运行时样式补丁**: `Bootstrap.config` 动态更新 `id="bs-config-patch"` 的 `<style>` 标签。通过 `!important` 覆盖 Bootstrap 内部硬编码的组件颜色(如 `.btn`, `.form-switch`, `.form-range`, `.progress-bar`, `.list-group-item`, `.nav-pills`, `.dropdown-menu`, `.navbar-nav .nav-link.active` 等)。
|
||||||
- **零构建支持**: 无需 Sass 重新编译,在纯 ESM 环境下即可实现全量主题定制。
|
- **零构建支持**: 无需 Sass 重新编译,在纯 ESM 环境下即可实现全量主题定制。
|
||||||
|
|||||||
18
dist/bootstrap.js
vendored
18
dist/bootstrap.js
vendored
@ -7233,6 +7233,24 @@ url("data:font/woff;base64,d09GRgABAAAAAsBAAAsAAAAHavgAAQAAAAAAAAAAAAAAAAAAAAAAA
|
|||||||
border-color: var(--bs-primary) !important;
|
border-color: var(--bs-primary) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 导航与下拉菜单 (Nav & Dropdown) */
|
||||||
|
.nav {
|
||||||
|
--bs-nav-link-color: var(--bs-body-color) !important;
|
||||||
|
--bs-nav-link-hover-color: var(--bs-primary) !important;
|
||||||
|
}
|
||||||
|
.nav-pills {
|
||||||
|
--bs-nav-pills-link-active-bg: var(--bs-primary) !important;
|
||||||
|
--bs-nav-pills-link-active-color: #fff !important;
|
||||||
|
}
|
||||||
|
.dropdown-menu {
|
||||||
|
--bs-dropdown-link-active-bg: var(--bs-primary) !important;
|
||||||
|
--bs-dropdown-link-active-color: #fff !important;
|
||||||
|
}
|
||||||
|
.navbar-nav .nav-link.active,
|
||||||
|
.navbar-nav .nav-link.show {
|
||||||
|
color: var(--bs-primary) !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* 列表组 (List Group) */
|
/* 列表组 (List Group) */
|
||||||
.list-group-item.active {
|
.list-group-item.active {
|
||||||
background-color: var(--bs-primary) !important;
|
background-color: var(--bs-primary) !important;
|
||||||
|
|||||||
2
dist/bootstrap.min.js
vendored
2
dist/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
21
src/index.js
21
src/index.js
@ -1,7 +1,7 @@
|
|||||||
import * as bootstrap from 'bootstrap'
|
import * as bootstrap from 'bootstrap'
|
||||||
import 'bootstrap/dist/css/bootstrap.min.css'
|
import 'bootstrap/dist/css/bootstrap.min.css'
|
||||||
import 'bootstrap-icons/font/bootstrap-icons.css'
|
import 'bootstrap-icons/font/bootstrap-icons.css'
|
||||||
import { Hash, LocalStorage, RefreshState } from '@apigo.cc/state'
|
import { Hash, LocalStorage } from '@apigo.cc/state'
|
||||||
|
|
||||||
const GlobalStates = { Hash, LocalStorage }
|
const GlobalStates = { Hash, LocalStorage }
|
||||||
|
|
||||||
@ -70,6 +70,24 @@ export const Bootstrap = {
|
|||||||
border-color: var(--bs-primary) !important;
|
border-color: var(--bs-primary) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 导航与下拉菜单 (Nav & Dropdown) */
|
||||||
|
.nav {
|
||||||
|
--bs-nav-link-color: var(--bs-body-color) !important;
|
||||||
|
--bs-nav-link-hover-color: var(--bs-primary) !important;
|
||||||
|
}
|
||||||
|
.nav-pills {
|
||||||
|
--bs-nav-pills-link-active-bg: var(--bs-primary) !important;
|
||||||
|
--bs-nav-pills-link-active-color: #fff !important;
|
||||||
|
}
|
||||||
|
.dropdown-menu {
|
||||||
|
--bs-dropdown-link-active-bg: var(--bs-primary) !important;
|
||||||
|
--bs-dropdown-link-active-color: #fff !important;
|
||||||
|
}
|
||||||
|
.navbar-nav .nav-link.active,
|
||||||
|
.navbar-nav .nav-link.show {
|
||||||
|
color: var(--bs-primary) !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* 列表组 (List Group) */
|
/* 列表组 (List Group) */
|
||||||
.list-group-item.active {
|
.list-group-item.active {
|
||||||
background-color: var(--bs-primary) !important;
|
background-color: var(--bs-primary) !important;
|
||||||
@ -128,4 +146,3 @@ if (typeof globalThis !== 'undefined') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default Bootstrap;
|
export default Bootstrap;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user