Skip to content

Commit

Permalink
feat(*): add dynamic LESS compilation of component variations
Browse files Browse the repository at this point in the history
This PR is a proposal for a solution to allow users to define which variations of an element will be compiled .
It was often requested to have a possibility to remove certain variations of an element from of the compiled CSS File.

I invented a central file `variation.variables` which is loaded into the default site.variables to enable all variations by default. If now somebody wants to remove for example the `tertiary` variant of the `button` element one just has to add  `@variationButtonTertiary: false` to their custom themes `site.variables`

Side effect improvements
-  Sizing logic has been unified, so `divider`, `reveal` and `card` also have size options now
- For the same reason, `header` and `statistic` also received missing size options (mini,big,massive)
- Removed unnecessary !important for `statistic` size options
  • Loading branch information
lubber-de authored and Sean committed Nov 13, 2019
1 parent f0a49e0 commit c048399
Show file tree
Hide file tree
Showing 58 changed files with 14,730 additions and 13,664 deletions.
47 changes: 18 additions & 29 deletions src/definitions/collections/breadcrumb.less
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,17 @@
padding: @segmentPadding;
}

/* Inverted */
.ui.inverted.breadcrumb {
color: @invertedColor;
}
.ui.inverted.breadcrumb > .active.section {
color: @invertedActiveColor;
}
.ui.inverted.breadcrumb > .divider {
color: @invertedDividerColor;
& when (@variationBreadcrumbInverted) {
/* Inverted */
.ui.inverted.breadcrumb {
color: @invertedColor;
}
.ui.inverted.breadcrumb > .active.section {
color: @invertedActiveColor;
}
.ui.inverted.breadcrumb > .divider {
color: @invertedDividerColor;
}
}

/*******************************
Expand All @@ -105,29 +107,16 @@
Variations
*******************************/

.ui.mini.breadcrumb {
font-size: @mini;
}
.ui.tiny.breadcrumb {
font-size: @tiny;
}
.ui.small.breadcrumb {
font-size: @small;
}
.ui.breadcrumb {
font-size: @medium;
}
.ui.large.breadcrumb {
font-size: @large;
}
.ui.big.breadcrumb {
font-size: @big;
}
.ui.huge.breadcrumb {
font-size: @huge;
}
.ui.massive.breadcrumb {
font-size: @massive;
& when not (@variationBreadcrumbSizes = false) {
each(@variationBreadcrumbSizes, {
@s: @@value;
.ui.@{value}.breadcrumb {
font-size: @s;
}
})
}

.loadUIOverrides();
Loading

0 comments on commit c048399

Please sign in to comment.