Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Feature Request: Multiplier value for FxLayoutGap #907

@CharlieGreenman

Description

@CharlieGreenman

Feature 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

Metadata

Metadata

Assignees

Labels

P5Low-priority issue that needs considerationdiscussionFurther discussion with the team is needed before proceedingfeaturehas prA PR has been created to address this issuein-progress

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions