-
-
Notifications
You must be signed in to change notification settings - Fork 7
feat(Region): support dark theme #606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,8 +9,18 @@ | |||||||||||||||
| .dropdown-menu { | ||||||||||||||||
| --bs-dropdown-padding-y: .5rem; | ||||||||||||||||
| --bs-dropdown-padding-x: .5rem; | ||||||||||||||||
| max-width: 400px; | ||||||||||||||||
| max-height: 400px; | ||||||||||||||||
| --bb-region-body-color: #495057; | ||||||||||||||||
| --bb-region-body-hover-bg-color: #e9ecef; | ||||||||||||||||
| --bb-region-body-active-bg-color: #dee2e6; | ||||||||||||||||
| --bb-region-body-hover-color: #000; | ||||||||||||||||
| --bb-region-body-active-color: #000; | ||||||||||||||||
| --bb-region-body-width: 400px; | ||||||||||||||||
| --bb-region-body-height: 400px; | ||||||||||||||||
| --bb-region-body-padding: .5rem; | ||||||||||||||||
| --bb-region-body-item-padding: 3px 12px; | ||||||||||||||||
| --bb-region-body-gap: 5px; | ||||||||||||||||
| width: var(--bb-region-body-width); | ||||||||||||||||
| height: var(--bb-region-body-height); | ||||||||||||||||
| overflow-y: auto; | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -19,37 +29,45 @@ | |||||||||||||||
| padding: 0; | ||||||||||||||||
| display: flex; | ||||||||||||||||
| flex-wrap: wrap; | ||||||||||||||||
| gap: 5px; | ||||||||||||||||
| gap: var(--bb-region-body-gap); | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| .dropdown-menu li { | ||||||||||||||||
| list-style: none; | ||||||||||||||||
| transition: background-color .3s linear, color .3s linear; | ||||||||||||||||
| cursor: pointer; | ||||||||||||||||
| padding: 3px 12px; | ||||||||||||||||
| padding: var(--bb-region-body-item-padding); | ||||||||||||||||
| border-radius: var(--bs-border-radius); | ||||||||||||||||
| color: #777; | ||||||||||||||||
| color: var(--bb-region-body-color); | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| .dropdown-menu li:hover { | ||||||||||||||||
| background-color: #e9ecef; | ||||||||||||||||
| color: #000; | ||||||||||||||||
| background-color: var(--bb-region-body-hover-bg-color); | ||||||||||||||||
| color: var(--bb-region-body-hover-color); | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
|
||||||||||||||||
| .dropdown-menu li:focus-visible { | |
| background-color: var(--bb-region-body-hover-bg-color); | |
| color: var(--bb-region-body-hover-color); | |
| outline: 0; | |
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,18 @@ | |
|
|
||
| .dropdown-menu { | ||
| --bs-dropdown-padding-y: 0; | ||
| --bb-region-header-padding: 3px 12px; | ||
| --bb-region-header-hover-bg-color: #e9ecef; | ||
| --bb-region-header-active-bg-color: #dee2e6; | ||
| --bb-region-body-color: #495057; | ||
| --bb-region-body-hover-bg-color: #e9ecef; | ||
| --bb-region-body-active-bg-color: #dee2e6; | ||
| --bb-region-body-hover-color: #000; | ||
| --bb-region-body-active-color: #000; | ||
| --bb-region-body-width: 400px; | ||
| --bb-region-body-padding: .5rem; | ||
| --bb-region-body-item-padding: 3px 12px; | ||
| --bb-region-body-gap: 5px; | ||
|
Comment on lines
+11
to
+22
|
||
| } | ||
|
|
||
| .dropdown-menu ul { | ||
|
|
@@ -20,8 +32,18 @@ | |
| transition: background-color .3s linear, color .3s linear; | ||
| } | ||
|
|
||
| [data-bs-theme="dark"] .dropdown-menu { | ||
| --bb-region-header-hover-bg-color: #495057; | ||
| --bb-region-header-active-bg-color: #6c757d; | ||
| --bb-region-body-color: #ddd; | ||
| --bb-region-body-hover-color: #fff; | ||
| --bb-region-body-active-color: #fff; | ||
| --bb-region-body-hover-bg-color: #495057; | ||
| --bb-region-body-active-bg-color: #6c757d; | ||
| } | ||
|
|
||
| .bb-region-header { | ||
| width: 400px; | ||
| width: var(--bb-region-body-width); | ||
| border-bottom: 1px solid var(--bs-border-color); | ||
| } | ||
|
|
||
|
|
@@ -35,48 +57,48 @@ | |
|
|
||
| .bb-region-header ul li { | ||
| cursor: pointer; | ||
| padding: 3px 12px; | ||
| padding: var(--bb-region-header-padding); | ||
| border-radius: var(--bs-border-radius); | ||
| } | ||
|
|
||
| .bb-region-header ul li.active { | ||
| background-color: #e3e3e3; | ||
| color: #000; | ||
| background-color: var(--bb-region-header-active-bg-color); | ||
| color: var(--bb-region-body-active-color); | ||
| } | ||
|
|
||
| .bb-region-header ul li:hover { | ||
| background-color: #e3e3e3; | ||
| color: #000; | ||
| background-color: var(--bb-region-header-hover-bg-color); | ||
| color: var(--bb-region-body-hover-color); | ||
|
Comment on lines
+65
to
+71
|
||
| } | ||
|
|
||
| .bb-region-body { | ||
| padding: .5rem; | ||
| width: 400px; | ||
| padding: var(--bb-region-body-padding); | ||
| width: var(--bb-region-body-width); | ||
| } | ||
|
|
||
| .bb-region-body ul { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| gap: 5px; | ||
| gap: var(--bb-region-body-gap); | ||
| } | ||
|
|
||
| .bb-region-body .bb-region-body-item:not(.active) { | ||
| display: none; | ||
| } | ||
|
|
||
| .bb-region-body ul li { | ||
| padding: 3px 12px; | ||
| padding: var(--bb-region-body-item-padding); | ||
| border-radius: var(--bs-border-radius); | ||
| color: var(--bb-region-body-color); | ||
| cursor: pointer; | ||
| color: #777; | ||
| } | ||
|
|
||
| .bb-region-body ul li:hover { | ||
| background-color: #e9ecef; | ||
| color: #000; | ||
| background-color: var(--bb-region-body-hover-bg-color); | ||
| color: var(--bb-region-body-hover-color); | ||
| } | ||
|
Comment on lines
96
to
99
|
||
|
|
||
| .bb-region-body ul li.active { | ||
| background-color: #e3e3e3; | ||
| color: #000; | ||
| background-color: var(--bb-region-body-active-bg-color); | ||
| color: var(--bb-region-body-active-color); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change replaces the previous max-width/max-height with fixed width/height, which alters the component's behavior (potentially introducing excess whitespace for small content and constraining growth for larger content). To preserve prior behavior and avoid a breaking visual change, use max-width and max-height with the new variables.