enough.css version 2.0: real responsiveness, outlined code blocks, and 27 % smaller

Enough.css’s first commit was on January 2nd, 2017. After it’d been stable for about four years, version 1.0 was released on January 7th, 2021. Today, almost nine years after its inception, enough.css 2.0 is simpler, more responsive, and comes with better code blocks, all in 347 bytes.

No more modules

Previously, enough.css was split up into separate modules. For example, the styling for tables was in a file named enough.table.css. This allowed users to omit some of the modules for projects that didn’t require them.

Enough.css 2.0 removes the modules and places all of the styling in a single 347-byte file. To reduce the size of the style sheet beyond that, unnecessary lines can be removed manually or using a tool like PurgeCSS.

Responsive font sizes

The previous version of enough.css had a module named enough.media.css, which had media rules based on screen sizes. The screen sizes were hard coded to 466, 740 and 1140 pixels, and were based on screen resolutions on mobile devices.

In 2.x, font sizes are always \(16 px +window width*0.025\). This adds support for any screen size, even if users request the page on even larger monitors somewhere in the future. Also, this makes resizing a smoother experience, as the text gradually resizes instead of jumping from one size to another while resizing the window.

Table 1: Enough.css font sizes compared between version 2.x and 1.x
Window width > (px) 2.x 1.x
3200 24. 22.
2800 23. 22.
2400 22. 22.
2000 21. 22.
1600 20. 22.
1200 19. 22.
1140 18.85 22.
800 18. 20.
740 17.85 20.
466 17.165 18.
400 17. 16.
0 16. 16.

Aside from the text scaling, the general font sizes are a bit smaller than in 1.x, the line heights are a bit tighter, and the page widths are wider to allow for more text on the page.

Code block styling

Enough.css used to have a code blocks with ghostwhite backgrounds. While these made code blocks stand out from body text, the light backgrounds didn’t work in dark mode.

To fully embrace dark mode while having code blocks that stand out from the rest of the page, enough.css 2.x omits the background color and only uses outlines for code blocks.

347 bytes

Minified, enough.css 2.0 clocks in at 347 bytes, as compared to 1.0.1’s 478, without removing any functionality and even adding some extra styling. This was mostly achieved through the new responsive fonts implementation, which removes three @media rules while having real responsive text instead.