Skip to content

Instantly share code, notes, and snippets.

@mardr
Forked from brandonb927/example.less
Last active February 22, 2020 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mardr/48b9138cc614bf9454e6be9d5f3d8567 to your computer and use it in GitHub Desktop.
Save mardr/48b9138cc614bf9454e6be9d5f3d8567 to your computer and use it in GitHub Desktop.
Retina font-weight for thin fonts in HiDPI typography #less
@import "retina.less";
.body-text {
.retina-font-weight();
}
.retina-font-weight(@ratio: 1.25) {
@dpi : @ratio * 96;
font-weight: normal;
@media only screen and (-webkit-min-device-pixel-ratio: @ratio),
only screen and (min-device-pixel-ratio: @ratio),
only screen and (min-resolution: ~'@{dpi}dpi') {
font-weight: 300;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment