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

Aliases for the resolution mixin #1

Open
meduzen opened this issue Apr 26, 2019 · 2 comments
Open

Aliases for the resolution mixin #1

meduzen opened this issue Apr 26, 2019 · 2 comments
Labels
--enhancement New feature or request

Comments

@meduzen
Copy link
Owner

meduzen commented Apr 26, 2019

Along the resolution mixins could be added mixins that’d generate the same output but only using the ddpx unit (for when IE/Safari support isn’t needed) or only the dpi unit (e.g. for print stylesheets).

Now

Declaration

@include --resolution-from('1x', 1);

is like declaring:

@custom-media --resolution-from-1x (resolution >= 1dppx, resolution >= 96dpi)

Usage

@media (--resolution-from-1x) {}

generates:

@media (min-resolution: 1dppx), (min-resolution: 96dpi) {}

New mixins proposal

Declaration

@include --dpi-is('hq-t-shirt', 380);

is like declaring:

@custom-media --dpi-tshirt-hq (resolution: 380dpi)

Usage

@media (--dpi-tshirt-hq) {}

generates:

@media (resolution: 380dpi) {}

(And same logic with ddpx.)

@meduzen meduzen added the --enhancement New feature or request label Apr 26, 2019
@meduzen
Copy link
Owner Author

meduzen commented Jul 6, 2019

Additional suggestion: also add support for dpcm.

@meduzen
Copy link
Owner Author

meduzen commented Jul 17, 2022

Alternative: along the suggestion in the previous messages, a setting could contain a list of wanted units (e.g. $resolution-units: dpi, dppx;.

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

No branches or pull requests

1 participant