The project I am currently working on requires implementing an accessibility feature for variable font size in our application. We currently use less css, and I am trying to figure out what is the best way to accomplish increasing or decreasing the font sized based on what setting the user has chosen. Unlike the more common use-case, the font-size does not vary based on screen width, so I have to figure out some way to set the font-size such as perhaps a media query for a cookie or URL parameter?
Here is an example of the strategy I envision, but I cannot figure out what kind of media query I would need:
@smallFont: ~"(???)"; //What do I do here?
@medFont: ~"(???)";
@largeFont: ~"(???)";
@media @smallFont{
@var-font-size: 0px;
}
@media @medFont{
@var-font-size: 2px;
}
@media @largeFont{
@var-font-size: 4px;
}
@font-size-xsmall: 14 + @var-font-size;
@font-size-smaller: 16 + @var-font-size;
@font-size-small: 18 + @var-font-size;
@font-size-medium: 20 + @var-font-size;