<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Angel Alagao on Medium]]></title>
        <description><![CDATA[Stories by Angel Alagao on Medium]]></description>
        <link>https://medium.com/@angelalagao?source=rss-95afbdb324b9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*oArD9af-2YhDFVWR.jpg</url>
            <title>Stories by Angel Alagao on Medium</title>
            <link>https://medium.com/@angelalagao?source=rss-95afbdb324b9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 17:15:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@angelalagao/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Fluid Typography]]></title>
            <link>https://medium.com/@angelalagao/fluid-typography-868aa1346d9e?source=rss-95afbdb324b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/868aa1346d9e</guid>
            <category><![CDATA[typography]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[responsive-design]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Angel Alagao]]></dc:creator>
            <pubDate>Thu, 11 May 2017 03:37:50 GMT</pubDate>
            <atom:updated>2017-05-11T03:42:11.312Z</atom:updated>
            <content:encoded><![CDATA[<p>Consistency across all viewports and screen sizes is something us developers should heavily consider when we are building out our websites. Here’s why:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*_gIT4Kael5G3wm3smb8Uuw.png" /><figcaption>Visualization of device sizes across the globe by OpenSignal. Android on the left, Apple on the right</figcaption></figure><p><a href="https://opensignal.com/reports/fragmentation.php">Android’s many screen shapes and sizes</a> and Apple’s fantastic four are what we have to keep in mind in responsive design. Sure, that 28px header font might look great on the iPhone6, but what about all the other infinite number of devices with smaller and larger screens? This is where we might want to consider implementing fluid typography in order to support these viewports.</p><h3>Fluid vs. Responsive</h3><p>With such a wide range of device sizes out there, using the standard responsive techniques and setting fixed font-sizes at different breakpoints might not be enough.</p><p>Here is an example of responsive typography:</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fcodepen.io%2Fangelalagao%2Fpen%2FaWYzOm&amp;src=https%3A%2F%2Fcodepen.io%2Fangelalagao%2Fembed%2Fpreview%2FaWYzOm%3Fheight%3D600%26slug-hash%3DaWYzOm%26default-tabs%3Dhtml%2Cresult%26host%3Dhttp%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;type=text%2Fhtml&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/7dbad872e27cd5b345db3dc4b29506ff/href">https://medium.com/media/7dbad872e27cd5b345db3dc4b29506ff/href</a></iframe><p>If you try resizing it, you can see the font-sizes breaking at different media queries.</p><p>On the other hand:</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fcodepen.io%2Fangelalagao%2Fpen%2FPmRwXv%2F&amp;src=https%3A%2F%2Fcodepen.io%2Fangelalagao%2Fembed%2Fpreview%2FPmRwXv%3Fheight%3D600%26slug-hash%3DPmRwXv%26default-tabs%3Dhtml%2Cresult%26host%3Dhttp%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;type=text%2Fhtml&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/dfe5894762fbe2cdbe972b3d3519efe0/href">https://medium.com/media/dfe5894762fbe2cdbe972b3d3519efe0/href</a></iframe><p>Fluid typography allows for the text to resize smoothly to match ANY device width.</p><p>OK. But how? Surely, it would be insane to think about having to add a media query to every device size out there.</p><p>By using <strong>viewport units</strong> and the <strong>calc()</strong> function in our CSS, we can have font-size adjust their size based on the size of the screen. So rather than always being the same size, or jumping from one size to the next at breakpoints, the font-size can be fluid.</p><p><strong>Viewport Units </strong>refer to a percentage of the browser’s viewport dimensions. <br>e.g. 1 viewport width (vw) is equal to 1% of the viewport’s width.</p><p>The downside to using viewport units as a value alone on our font-size property is that it is ALWAYS relative to the viewport. So, on super small screens, we could end up with ridiculously small font-sizes.</p><h4>Where calc() comes into play</h4><p>We can control where the font-size stops growing/shrinking relative to our viewport by using a *little bit* of calc():</p><pre>h1, h2 {</pre><pre><strong>font-size</strong>: calc([minimum size] + ([maximum size] - [minimum size]) * ((100vw - [minimum viewport width]) / ([maximum viewport width] - [minimum viewport width])));</pre><pre>}</pre><p>Credits to <a href="https://madebymike.com.au/writing/fluid-type-calc-examples/">Mike Riethmuller</a></p><p>By plugging in values in this holy grail equation we can achieve fluidity in our typography. Efficiently, we can automate this equation by plugging these values in set mixins using SASS. Ideally we still want to use this equation at different media queries to avoid drastic shrinkage/growth of our font size.</p><p>For example:</p><pre><a href="http://twitter.com/media">@media</a> (max-width: 768px) {<br> <br> h2.hero {<br>   font-size: calc(8rem + (10 - 8) * ((100vw - 481px) / (768 - 481)));<br> <br>}</pre><pre><a href="http://twitter.com/media">@media</a> (max-width: 480px) {<br><br> h2.hero {<br>   font-size: calc(5.2rem + (8 - 5.2) * ((100vw - 300px) / (480 - 300)));</pre><pre> }</pre><p>Implementing this equation in our media queries will allow for more control in terms of making font-size relative to the layout across all devices.</p><p>With wide browser support, fluid typography is definitely an intuitive option for a web in which we have a practically infinite number of screen sizes to support. It can be simply achieved without losing control over many important aspects of design, which ties back to the consistency we have to consider as developers :)</p><p>Sources:<br><a href="https://css-tricks.com/snippets/css/fluid-typography/">CSS-Tricks</a>, <a href="https://www.smashingmagazine.com/2016/05/fluid-typography/">Smashing-Mag</a> &amp; <a href="https://medium.com/@jakobud/css-polyfluidsizing-using-calc-vw-breakpoints-and-linear-equations-8e15505d21ab">CSS Poly-fluid Sizing</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=868aa1346d9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Math is Useful After All]]></title>
            <link>https://medium.com/@angelalagao/why-math-is-useful-after-all-365dd675a8c7?source=rss-95afbdb324b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/365dd675a8c7</guid>
            <category><![CDATA[codingbootcamp]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Angel Alagao]]></dc:creator>
            <pubDate>Mon, 01 May 2017 00:44:12 GMT</pubDate>
            <atom:updated>2017-05-01T03:10:38.165Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*-70TkZq3o32UoAbYzpXwdA.gif" /></figure><p>Let’s be honest, you probably hate math. Unless you’re <a href="https://en.wikipedia.org/wiki/Good_Will_Hunting">Will Hunting</a> of course, but even he chose love instead of math. (“It’s not your fault”. RIP Robin Williams — probably my favourite actor of all time.) As a learning developer however, mathematics and love may just very well complement one another. (Just me?)</p><p>For the current project I am working on, I am limited to only using <a href="https://developer.mozilla.org/en/docs/Web/CSS/float?v=control">floats</a> (Don’t even get me started, floats suck lol). Luckily however, I found a godly silver lining.</p><h4>calc() CSS function</h4><p>Exploring the <a href="https://developer.mozilla.org/en/docs/Web/CSS/calc">calc()</a> CSS function has been a delight when it comes to resizing. Because:</p><ol><li>It does the math for us.</li><li>It allows fluidity across any layout.</li><li>It does the math for us.</li></ol><p>When dealing with pixel-value margins however, we might have to do some math.</p><h4>It’s simple math, not the complicated kind</h4><p>So don’t worry.</p><p>Here is an example of where you might run into a problem with your layout, where you are using percentage-based widths and pixel-value margins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7AMY25aGa-5YN5ONGct_Ng.png" /><figcaption>Without calc()</figcaption></figure><pre>.suggested-post figure {<br> width: 25%;<br> margin-right: 20px;<br> float: left;<br>}</pre><p>Now here is where we would have to do some math on our own to account for the margin, right? (*pun intended*). With 60px of margin in total, we would just have to divide it by 4 and use this value to subtract from our percentage width.</p><pre>60px/4 = 15px</pre><p>We can express this in the calc() function, using the subtraction operator.</p><pre>width: calc(25% - 15px);</pre><p>To remove the margin on the last figure, we would just need to add the pseudo-class, <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:last-child">last-child</a>.</p><pre>.suggested-post figure:last-child {<br> margin-right: 0;<br>}</pre><p>And, viola.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4r6iJUEdQD7P4cTZjRHptA.png" /><figcaption>With calc()</figcaption></figure><pre>.suggested-post figure {<br> width: calc(25% - 15px);<br> margin-right: 20px;<br> float: left;<br>}</pre><pre>.suggested-post figure:last-child {<br> margin-right: 0;<br>}</pre><h4>Easy-peasy, Lemon-squeezy</h4><p>If I was not limited to using floats, I probably would have <a href="https://developer.mozilla.org/en/docs/Web/CSS/flex?v=control">flex-box</a>’d the hell out of this project. But in this case, calc() in addition to <a href="https://developer.mozilla.org/en/docs/Web/CSS/Pseudo-classes">pseudo-classes</a> (Shout outs to <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:last-child">last-child</a>!) have been very helpful.</p><p>Hence, math is indeed useful after all.</p><p>Oops, I forgot to tell you. I am currently attending <a href="http://hackeryou.com/">HackerYou</a>’s immersive 9-week bootcamp! It’s been pretty great so far. #BootCampLife #Cohort14</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=365dd675a8c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>