Feature Request: Multiplier value for FxLayoutGap
See original GitHub issueFeature Request
What is the desired behavior?
FxLayoutGap should have multiplier for attaining a pixel value.
What is the use-case or motivation for the desired behavior?
Well this is an Angular library. Many people who use Angular use Angular Material. Was just playing around with the idea of fxLayoutGap taking in a multiplier. So for instance, Angular Material Layout is generally in multiples of 8, with the exception of icons which can be 4. So fxLayoutGap="1x"
would be 8px
. fxLayoutGap="2x"
would be 16px
Is there anything else we should know?
Nothing other than this is just an idea. Using flex in a css setting, allows us to set a constant that is there already at build time. It’s comforting knowing that if we need to change the value across the board, we can do that for our entire app. Right now just throwing out having a default value based on material. However, having a multiplier based on one’s style sheet is just a cool idea. Having a multiplier for fxLayoutGap
that is stamped with the performance stamp of approval, would be fantastic. Thank you!
// Gutter variables, for padding + margin
// function to take in multiplier(8), which must emit one of the values within fx-space-amounts
@function fx-space-multiplier($n) {
$fx-space-amounts: (
0,
4,
8,
16,
24,
32,
40,
48,
56,
64
);
$fx-space-multiplier: 8;
@if (index($fx-space-amounts, ($n * $fx-space-multiplier))) {
@return #{$n * $fx-space-multiplier}px;
} @else {
@error 'Must contain one of the following numbers: #{$fx-space-amounts}.';
}
}
^ something equivalent to above, but for fxLayoutGap
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:13 (7 by maintainers)
Top GitHub Comments
@CharlieGreenman - please send me your email to ThomasBurleson@gmail.com
Sounds good on making it only apply to those two directives, and probably also
gdGap
.I was thinking maybe we would add this to
LayoutConfigOptions
. And that maybe we wouldn’t throw an error for non-integer values, but those would obviously render weirdly when the values get applied.Do you want to put together a PR for this, or would you rather we implement it? If you want the commit credit, I think you deserve it!