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

Support Material Density #841

Open
dfreedm opened this issue Feb 5, 2020 · 12 comments
Open

Support Material Density #841

dfreedm opened this issue Feb 5, 2020 · 12 comments

Comments

@dfreedm
Copy link
Collaborator

dfreedm commented Feb 5, 2020

The MDC Density system currently relies completely on Sass mixins, which is not compatible with how we are using the Sass with Web Components.

We need to provide a way to do this via CSS Custom Properties, or a theming system.

@TomzBench
Copy link

@use "@material/button";

.my-custom-button {
  // Sets button density scale to `-3`, i.e. button height to `24px`.
  @include button.density(-3);
}

Is it possible to pass through this API? I tried that before reaching here and am blocked by the shadowroot. However, if I can passthrough my styles to the shadow root styles as a work around?

If the base class had a method to merge the component static styles property then wouldnt the mwc density API work?

@asyncLiz asyncLiz self-assigned this Mar 13, 2020
@asyncLiz
Copy link
Collaborator

It's not possible to use MDC's sass density mixins with MWC. We're actively working on a solution though!

@TomzBench
Copy link

TomzBench commented Mar 13, 2020

Will the solution allow using MDC sass mixins with MWC?

Or is the solution going to be wrapping all of MDC functionality with a unique wrapper API? I vote for the former!

@yinonov
Copy link

yinonov commented May 21, 2020

Where does this stand? Density is a fundamental abstraction in our branding identity. Would love to be able to control it with a high level variable

@asyncLiz
Copy link
Collaborator

It's planned out, but a few things have slipped behind due to the COVID situation. This should be coming soon though after some theming work.

@maicol07
Copy link

maicol07 commented Feb 9, 2021

It has been almost 1 year since the last update. Is it coming soon?

@Daymannovaes
Copy link

Me too. I constantly rely on the use-case of an mwc-button with a different height.

@lsatheeshkumar
Copy link

An update on this would be of great help.

@aress31
Copy link

aress31 commented Mar 17, 2021

+1

@JamesODonoghue
Copy link

We are also looking forward to this support.

Any updates would be greate

@milesje
Copy link

milesje commented Aug 5, 2021

Any update on this???

@asyncLiz
Copy link
Collaborator

asyncLiz commented Aug 6, 2021

Density support is slowly being added as components' theming capabilities are being updated. <mwc-switch> is a good first example:

@use '@material/mwc-switch';

mwc-switch.dense {
  @include mwc-switch.theme(mwc-switch.density(-1));
}

Generates:

mwc-switch.dense {
  --mdc-switch-state-layer-size: 44px;
}

@asyncLiz asyncLiz removed the Theming label Jan 2, 2024
@asyncLiz asyncLiz removed their assignment Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants