Skip to content
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

✨ feat(bal-popover): add css customization #872

Merged
merged 3 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changeset/angry-peaches-impress.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ add new css variables for theming to components and css-framework
- bal-hint
- bal-sheet
- bal-select
- bal-popover
- bal-stage
- bal-footer
- bal-pagination
Expand Down
22 changes: 10 additions & 12 deletions packages/components/src/components/bal-popover/bal-popover.sass
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
@import '@baloise/design-system-css/sass/mixins'

:root
--bal-popover-backdrop-height: 100vh
--bal-popover-content-height-top-nav: 100vh
@import './bal-popover.vars'

+block(popover)
display: block
Expand Down Expand Up @@ -33,15 +30,16 @@
@extend %overlay
z-index: 10
position: fixed
background-color: rgba($bal-color-primary-6, .8)
background: var(--bal-popover-backdrop-background)
opacity: var(--bal-popover-backdrop-opacity)
height: var(--bal-popover-backdrop-height)
width: 100vw

+element(content)
display: none
z-index: 25
box-shadow: var(--bal-shadow-normal)
background: var(--bal-color-white)
box-shadow: var(--bal-popover-content-shadow)
background: var(--bal-popover-content-background)
min-width: 16.25rem
&[data-show]
display: block
Expand Down Expand Up @@ -76,7 +74,7 @@
height: var(--bal-popover-content-height-top-nav)
overflow-y: auto
+modifier(color-grey)
background: var(--bal-color-grey-2)
background: var(--bal-popover-content-background-grey)
+element(inner)
max-height: calc(100vh - 4.5rem)
overflow: auto
Expand Down Expand Up @@ -124,11 +122,11 @@
+modifier(tooltip)
.bal-popover__content
min-width: unset
background: var(--bal-color-primary-6)
background: var(--bal-popover-tooltip-background)
.bal-popover__content__inner
padding: var(--bal-space-x-small)
&,
p
color: var(--bal-color-white)
font-family: var(--bal-font-family-text)
font-size: var(--bal-size-small)
color: var(--bal-popover-tooltip-color)
font-family: var(--bal-popover-tooltip-font-family)
font-size: var(--bal-popover-tooltip-font-size)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* @prop --bal-popover-backdrop-height: TBD
* @prop --bal-popover-content-height-top-nav: TBD
* @prop --bal-popover-backdrop-background: TBD
* @prop --bal-popover-backdrop-opacity: TBD
* @prop --bal-popover-content-shadow: TBD
* @prop --bal-popover-content-background: TBD
* @prop --bal-popover-content-background-grey: TBD
* @prop --bal-popover-tooltip-background: TBD
* @prop --bal-popover-tooltip-color: TBD
* @prop --bal-popover-tooltip-font-family: TBD
* @prop --bal-popover-tooltip-font-size: TBD
*/

:root
--bal-popover-backdrop-height: 100vh
--bal-popover-content-height-top-nav: 100vh
--bal-popover-backdrop-background: var(--bal-color-primary-6)
--bal-popover-backdrop-opacity: .8
--bal-popover-content-shadow: var(--bal-shadow-normal)
--bal-popover-content-background: var(--bal-color-white)
--bal-popover-content-background-grey: var(--bal-color-grey-2)
--bal-popover-tooltip-background: var(--bal-color-primary-6)
--bal-popover-tooltip-color: var(--bal-color-white)
--bal-popover-tooltip-font-family: var(--bal-font-family-text)
--bal-popover-tooltip-font-size: var(--bal-size-small)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Theming

The component can be customization by changing the CSS variables.

<a class="button is-primary" href="../?path=/docs/development-theming--page">Go to theming guide</a>

<!-- START: human documentation -->



<!-- END: human documentation -->

### CSS Custom Variables​

| Variable |
| --------------------------------------- |
| `--bal-popover-backdrop-height` |
| `--bal-popover-content-height-top-nav` |
| `--bal-popover-backdrop-background` |
| `--bal-popover-backdrop-opacity` |
| `--bal-popover-content-shadow` |
| `--bal-popover-content-background` |
| `--bal-popover-content-background-grey` |
| `--bal-popover-tooltip-background` |
| `--bal-popover-tooltip-color` |
| `--bal-popover-tooltip-font-family` |
| `--bal-popover-tooltip-font-size` |