Skip to content

Commit

Permalink
perf: lazy load component styles
Browse files Browse the repository at this point in the history
  • Loading branch information
hirsch88 committed Oct 31, 2022
1 parent 9ac37b1 commit 2f90efe
Show file tree
Hide file tree
Showing 70 changed files with 176 additions and 82 deletions.
Original file line number Diff line number Diff line change
@@ -1,77 +1,6 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

bal-accordion,
.bal-accordion
position: static
display: block

// bal-accordion {
// display: block;
// border-radius: $radius-large;
// & > bal-button,
// & bal-button > button {
// border-radius: $radius-large;
// }
// span.trigger-label {
// display: flex;
// justify-content: center;
// align-items: center;
// span.label {
// font-size: $size-normal;
// line-height: $size-normal;
// }
// }
// bal-icon {
// margin-right: 8px;
// }
// .accordion-content.is-info {
// border-top: 1px solid $blue-2;
// }
// .accordion-content {
// border-bottom-left-radius: $radius-large;
// border-bottom-right-radius: $radius-large;
// }
// &.bal-accordion-light {
// border-bottom: 2px solid $blue;
// border-radius: 0;
// button {
// padding-left: 0;
// padding-right: 0;
// border: none !important;
// span.button-label {
// flex: 1;
// text-align: left;
// }
// bal-icon.icon-right {
// margin-right: 0px !important;
// }
// &:hover,
// &.is-hovered,
// &:focus,
// &:focus-visible,
// &.is-focused,
// &:active,
// &.is-active {
// background: transparent !important;
// }
// }
// }
// &:not(.bal-accordion-light) {
// .accordion-content {
// & > .p-5 {
// padding-top: 0 !important;
// margin-bottom: 0 !important;
// }
// }
// }
// }
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { Events } from '../../types'

@Component({
tag: 'bal-accordion',
styleUrls: {
css: 'bal-accordion.sass',
},
})
export class Accordion {
private didInit = false
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/components/bal-button/bal-button.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

bal-button,
.bal-button
display: inline-block
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/components/bal-button/bal-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { Props } from '../../types'

@Component({
tag: 'bal-button',
styleUrls: {
css: 'bal-button.sass',
},
})
export class Button implements ComponentInterface {
@Element() el!: HTMLElement
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/components/bal-card/bal-card.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

=card-spacing($spacing: 1rem)
& > :not(bal-badge):not(bal-tag):first-child
padding-top: $spacing
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/components/bal-card/bal-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { Props } from '../../types'

@Component({
tag: 'bal-card',
styleUrls: {
css: 'bal-card.sass',
},
})
export class BalCard {
/**
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/components/bal-close/bal-close.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

+block(close)
position: static
display: inline-block
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/components/bal-close/bal-close.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { BEM } from '../../utils/bem'

@Component({
tag: 'bal-close',
styleUrls: {
css: 'bal-close.sass',
},
})
export class Close implements ComponentInterface {
@Element() el!: HTMLElement
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/components/bal-data/bal-data.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

+block(data)
position: relative
display: flex
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/components/bal-data/bal-data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { BEM } from '../../utils/bem'

@Component({
tag: 'bal-data',
styleUrls: {
css: 'bal-data.sass',
},
})
export class Data {
@Element() element!: HTMLElement
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/components/bal-footer/bal-footer.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

+block(footer)
+unselectable
display: block
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/components/bal-footer/bal-footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import { BEM } from '../../utils/bem'

@Component({
tag: 'bal-footer',
styleUrls: {
css: 'bal-footer.sass',
},
})
export class Footer implements BalConfigObserver {
@State() links: FooterLink[] = []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

bal-heading,
.bal-heading
display: block
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { Props } from '../../types'

@Component({
tag: 'bal-heading',
styleUrls: {
css: 'bal-heading.sass',
},
})
export class Heading {
/**
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/components/bal-hint/bal-hint.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

+block(hint)
+unselectable
display: inline-block
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/components/bal-hint/bal-hint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import { ResizeHandler } from '../../utils/resize'

@Component({
tag: 'bal-hint',
styleUrls: {
css: 'bal-hint.sass',
},
})
export class Hint implements BalConfigObserver {
@Element() element!: HTMLElement
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/components/bal-icon/bal-icon.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

=iconSize($size: 1rem)
width: $size
max-height: $size
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/components/bal-icon/bal-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { BEM } from '../../utils/bem'

@Component({
tag: 'bal-icon',
styleUrls: {
css: 'bal-icon.sass',
},
})
export class Icon {
/**
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/components/bal-list/bal-list.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

.bal-list,
.bal-list__item,
.bal-list__item > a,
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/components/bal-list/bal-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { BEM } from '../../utils/bem'

@Component({
tag: 'bal-list',
styleUrls: {
css: 'bal-list.sass',
},
})
export class List {
/**
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/components/bal-navbar/bal-navbar.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

+block(navbar)
+unselectable
position: relative
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/components/bal-navbar/bal-navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { BEM } from '../../utils/bem'

@Component({
tag: 'bal-navbar',
styleUrls: {
css: 'bal-navbar.sass',
},
})
export class Navbar {
@Element() element!: HTMLElement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

:root
--bal-nav-main-mobile-height: 100vh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import { ResizeHandler } from '../../utils/resize'

@Component({
tag: 'bal-navigation',
styleUrls: {
css: 'bal-navigation.sass',
},
})
export class Navigation implements ComponentInterface {
@Element() el!: HTMLElement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

+block(pagination)
+unselectable
display: block
Expand Down Expand Up @@ -76,7 +78,7 @@

+element(tab)
flex: 1

&.is-disabled
li
pointer-events: none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { Props } from '../../types'

@Component({
tag: 'bal-pagination',
styleUrls: {
css: 'bal-pagination.sass',
},
})
export class Pagination {
@Element() el!: HTMLBalPaginationElement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

:root
--bal-popover-backdrop-height: 100vh
--bal-popover-content-height-top-nav: 100vh
Expand Down Expand Up @@ -126,4 +128,4 @@
font-family: var(--bal-font-family-text)
font-size: var(--bal-size-small)
.bal-popover__content__inner
padding: var(--bal-space-x-small)
padding: var(--bal-space-x-small)
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export interface PopoverPresentOptions {

@Component({
tag: 'bal-popover',
styleUrls: {
css: 'bal-popover.sass',
},
})
export class Popover {
private popoverId = `bal-po-${PopoverIds++}`
Expand Down
4 changes: 3 additions & 1 deletion packages/components/src/components/bal-shape/bal-shape.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

+block(shape)
display: block
overflow: hidden
Expand All @@ -19,4 +21,4 @@
+modifier(is-rotation-180)
transform: rotate(180deg)
+modifier(is-rotation-270)
transform: rotate(270deg)
transform: rotate(270deg)
3 changes: 3 additions & 0 deletions packages/components/src/components/bal-shape/bal-shape.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { BaloiseDesignToken } from '@baloise/design-system-tokens'

@Component({
tag: 'bal-shape',
styleUrls: {
css: 'bal-shape.sass',
},
})
export class Shape implements ComponentInterface {
@Element() el!: HTMLElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { flatten } from 'lottie-colorify'

@Component({
tag: 'bal-spinner',
styleUrls: {
css: 'bal-spinner.sass',
},
})
export class Spinner {
animation!: AnimationItem
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/components/bal-stage/bal-stage.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

+block(stage)
display: block
position: relative
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/components/bal-stage/bal-stage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { BEM } from '../../utils/bem'

@Component({
tag: 'bal-stage',
styleUrls: {
css: 'bal-stage.sass',
},
})
export class Stage implements ComponentInterface {
/**
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/components/bal-table/bal-table.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'

+block(table)
display: block
position: static
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/components/bal-table/bal-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { BEM } from '../../utils/bem'

@Component({
tag: 'bal-table',
styleUrls: {
css: 'bal-table.sass',
},
})
export class Table implements ComponentInterface {
@Element() el!: HTMLElement
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/components/bal-tabs/bal-tabs.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import '~@baloise/design-system-css/scss/baloise-design-system.utilities'
@import './bal-tabs__steps'

+block(tabs)
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/components/bal-tabs/bal-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import { ResizeHandler } from '../../utils/resize'

@Component({
tag: 'bal-tabs',
styleUrls: {
css: 'bal-tabs.sass',
},
})
export class Tabs {
@Element() el!: HTMLElement
Expand Down
Loading

0 comments on commit 2f90efe

Please sign in to comment.