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

Layout paddings and margins #2319

Open
1 task done
Fercas123 opened this issue Aug 30, 2023 · 6 comments
Open
1 task done

Layout paddings and margins #2319

Fercas123 opened this issue Aug 30, 2023 · 6 comments
Assignees
Labels
type: enhancement 💡 New feature or request

Comments

@Fercas123
Copy link
Contributor

Area

UI Components

The problem

When implementing layout components, we've come across the constant need to implement a class just to add paddings and margins that come from a theme level variable.

The solution

Layout components could have a default multiplier of 0 to keep the margin and padding off, but allow for easy implementation trough variables.

Alternatives and examples

for flex implementation:

...
/* Default variables applied to the root element */
.saltFlexLayout {
  --flexLayout-gap-multiplier: var(--flexLayout-gap-density-multiplier, 3);
  ++ --flexLayout-margin-multiplier: var(--flexLayout-margin-density-multiplier, 0);
  ++ --flexLayout-padding-multiplier: var(--flexLayout-padding-density-multiplier, 0);
  --flexLayout-layout-display: flex;
  --flexLayout-direction: row;
  --flexLayout-wrap: nowrap;
  --flexLayout-justify: flex-start;
  --flexLayout-align: stretch;
  --flexLayout-separator: var(--salt-size-border);
  --flexLayout-gap: calc(var(--salt-size-unit) * var(--flexLayout-gap-multiplier));
  ++ --flexLayout-margin: calc(var(--salt-spacing-100) * var(--flexLayout-margin-multiplier));
  ++ --flexLayout-padding: calc(var(--salt-spacing-100) * var(--flexLayout-padding-multiplier));
}

/* Style applied to the root element */
.saltFlexLayout {
  gap: var(--flexLayout-gap);
  ++ margin: var(--flexLayout-margin);
  ++ padding: var(--flexLayout-padding);
  ...

Are you a JPMorgan Chase & Co. employee?

  • I am an employee of JPMorgan Chase & Co.
@Fercas123 Fercas123 added type: enhancement 💡 New feature or request status: awaiting triage Automatically added to new issues. Should be removed once they have been triaged. labels Aug 30, 2023
@Fercas123
Copy link
Contributor Author

@bhoppers2008 tagging you for visibility

@joshwooding joshwooding removed the status: awaiting triage Automatically added to new issues. Should be removed once they have been triaged. label Jan 14, 2025
@bhoppers2008
Copy link

Sprint goal: PR review
@Fercas123 has PR up for review + support from design.

@mark-tate
Copy link
Contributor

Tecno goal: will be released to Core in next release
Reviewers: stakeholder review required by EOS, ask MTK
Mark to review

@mark-tate
Copy link
Contributor

2 ticks away..
Kris and I will review by next standup

@mark-tate
Copy link
Contributor

example improvement to be added by EOS

@mark-tate
Copy link
Contributor

examples updated and new review required

Grid changes blocked then by this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement 💡 New feature or request
Projects
Development

No branches or pull requests

4 participants