One of the things you can specify in any length-based CSS property is a value with an em or remĥem means “5 times the font-size of the element this is applied to”. The mechanism of the scaling was also complex, however The relative keywords basically scale the size up or down. Is not straightforward, and I’ll get to that later in this post. size=3 is the same as font-size: medium). Essentially, the absolute keywords map to various pixel values, and match The first three are common amongst quite a few length-related properties. An absolute keyword ( medium, small, large, x-large, etc).A compound of the above, via a calc ( calc(12px + 4em + 20%)).The syntax of the property is pretty straightforward. Let’s see what is so complex about font-size. I’ll also try to give an idea of how the styling system works throughout this post.Īlright.
I’m hoping this post can give an idea of how complex the Web can get, and also serve as documentationįor some of these complexities. Rendering, but font-size is probably the most complex one in the department of styling. Some properties may be more complicated when it comes to layout or
Inherit font size code#
Of the code being in a safer systems language.Īnyway, as far as the styling system is concerned, I believe that font-size is the most complex Stylo has the potential to bring these speedups into Firefox, along with the added safety Servo is in Rust, and makes use of Rust’s safe parallelism in many places, one of them being Only on page load, but also whenever various kinds of events (including DOM manipulation) occur,Īnd is a nontrivial portion of pageload and interaction times. Parsing CSS, determining which rules apply to which elements, running this through the cascade,Īnd eventually computing and assigning styles to individual elements in the tree. Stylo is the project to integrate Servo’s styling system into Firefox. And then I worked on implementing it for stylo. It’s a CSS property probably everyone who writes CSS has used at some point.