JSFiddle - React, Tailwind, and code Playground

by Mike Fitzpatrick

HTML

<p>Regular Font Size</p>
<p class="small-text">Small Font size</p>
<p class="large-text">Large Text Size</p>
<p class="small-text">Small Font size</p>
<a href="#" id="fix-text">Fix Small Fonts</a>

CSS

body {
    font-size: 12px;
}
.large-text {
    font-size: 18px;
}
.small-text {
    font-size: 8px;
}

JavaScript

$(function () {
    $("#fix-text").on("click", function (e) {
        e.preventDefault();
        $("p").each( function () {
            var $this = $(this);
            if (parseInt($this.css("fontSize")) < 12) {
                $this.css({ "font-size": "12px" });   
            }
        });
    });
});