1

I'm looking for a way to globally set the font-style for numbers ONLY, so that I don't have to repeat something like this about 500 times:

<p>The number <span class="number-styling">42</span> is awesomest.</p>

I've tried Googling a solution, but the search terms for this issue (i.e. 'style only numbers scss' etc.) are simply too general to get any good hits. I would prefer using SASS/SCSS for performance reasons, but if it's simply not possible then Javascript would also do. Preferably something that could be set once globally, i.e. like this:

$font-main: 'Roboto', sans-serif;

$font-number: 'Montserrat', sans-serif;

Thanks in advance.

  • The `unicode-range` answer in @Harun Yilmaz's link is probably the best solution you'll find in a non javascript way. – Frederick Dec 30 '19 at 14:03
  • Thanks, this answer was exactly what I was looking for! It was just a bit hard to find due to the related search terms. – JamesLowland Dec 30 '19 at 14:19

0 Answers0