<?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"><channel><title><![CDATA[Phemiwrites]]></title><description><![CDATA[Phemiwrites]]></description><link>https://phemiwrites.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 25 Oct 2026 19:11:25 GMT</lastBuildDate><atom:link href="https://phemiwrites.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Theming with SASS]]></title><description><![CDATA[I was recently working on a single page web app with basically HTML, SCSS and JavaScript. I configured an onClick event to toggle a class name, which is…]]></description><link>https://phemiwrites.hashnode.dev/theming-with-sass</link><guid isPermaLink="true">https://phemiwrites.hashnode.dev/theming-with-sass</guid><category><![CDATA[CSS]]></category><category><![CDATA[scss]]></category><category><![CDATA[CSS3]]></category><category><![CDATA[sa]]></category><category><![CDATA[nesting]]></category><dc:creator><![CDATA[Olubukunmi Olufemi]]></dc:creator><pubDate>Sun, 26 Jun 2022 12:51:28 GMT</pubDate><content:encoded><![CDATA[<p>I was recently working on a single page web app with basically HTML, SCSS and JavaScript. I configured an onClick event to toggle a class name, which is the basic way to change themes. A lot of times theming is just changing the background of the body and the color of elements displayed in it. However, with nesting in SASS I was able to not just change the basic background and text colors but also to nest elements I wanted to be affected by that class and change different aspects of them for a much more complex theme experience. This is obviously achievable with Vanilla CSS but nesting in SASS makes it much easier to do. Below is a basic example;</p>
<pre><code><span class="hljs-selector-class">.lightTheme</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-variable">$clr-white</span>;
    <span class="hljs-attribute">color</span>: <span class="hljs-variable">$clr-black</span>;

    <span class="hljs-selector-class">.main-section</span> {
        <span class="hljs-selector-tag">div</span><span class="hljs-selector-attr">[class="header"]</span> {

            <span class="hljs-selector-tag">span</span><span class="hljs-selector-attr">[id="dark"]</span> {
                <span class="hljs-attribute">display</span>: flex <span class="hljs-meta">!important</span>;
                <span class="hljs-attribute">color</span>: <span class="hljs-variable">$clr-grey</span>;
            }

            <span class="hljs-selector-tag">span</span><span class="hljs-selector-attr">[id="light"]</span> {
                <span class="hljs-attribute">display</span>: none;
            }

        }
    }

    <span class="hljs-selector-tag">div</span><span class="hljs-selector-attr">[class="search-bar"]</span> {
        <span class="hljs-attribute">background-color</span>: <span class="hljs-variable">$clr-white</span>;
        <span class="hljs-attribute">box-shadow</span>: rgba(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0.24</span>) <span class="hljs-number">0px</span> <span class="hljs-number">3px</span> <span class="hljs-number">8px</span>;

        <span class="hljs-selector-tag">input</span> {
            <span class="hljs-attribute">background-color</span>: <span class="hljs-variable">$clr-white</span>;
            <span class="hljs-attribute">color</span>: <span class="hljs-variable">$clr-grey</span>;
        }

        ::placeholder {
            color: <span class="hljs-variable">$clr-grey</span>;
        }
    }

    <span class="hljs-selector-tag">div</span><span class="hljs-selector-attr">[class="user-card-component"]</span> {
        <span class="hljs-attribute">background-color</span>: <span class="hljs-variable">$clr-white</span>;
        <span class="hljs-attribute">box-shadow</span>: rgba(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0.24</span>) <span class="hljs-number">0px</span> <span class="hljs-number">3px</span> <span class="hljs-number">8px</span>;
    }

    <span class="hljs-selector-tag">div</span><span class="hljs-selector-attr">[class="user-card-component-details"]</span> {

        <span class="hljs-selector-tag">div</span><span class="hljs-selector-attr">[class="user-info"]</span> {

            <span class="hljs-selector-tag">div</span><span class="hljs-selector-attr">[class="user-info-details"]</span>&gt;<span class="hljs-selector-tag">span</span> {
                <span class="hljs-selector-tag">span</span> {
                    <span class="hljs-attribute">color</span>: <span class="hljs-variable">$clr-grey</span>;
                }
            }

            <span class="hljs-selector-tag">div</span><span class="hljs-selector-attr">[class="user-info-stats"]</span> {
                <span class="hljs-attribute">background-color</span>: <span class="hljs-variable">$clr-blue</span>;

                <span class="hljs-selector-tag">h4</span> {
                    <span class="hljs-attribute">color</span>: <span class="hljs-variable">$clr-white</span>;
                }

                <span class="hljs-selector-tag">p</span> {
                    <span class="hljs-attribute">color</span>: <span class="hljs-variable">$clr-white</span>;
                }
            }
        }
    }
}
</code></pre>]]></content:encoded></item><item><title><![CDATA[Understanding the CSS Position Property]]></title><description><![CDATA[Probably one of the more confusing properties to grasp when getting into CSS is the position property. The position property specifies the position of an…]]></description><link>https://phemiwrites.hashnode.dev/understanding-the-css-position-property</link><guid isPermaLink="true">https://phemiwrites.hashnode.dev/understanding-the-css-position-property</guid><category><![CDATA[CSS]]></category><category><![CDATA[CSS3]]></category><category><![CDATA[Explain like I am five]]></category><category><![CDATA[HTML]]></category><category><![CDATA[styling]]></category><dc:creator><![CDATA[Olubukunmi Olufemi]]></dc:creator><pubDate>Tue, 29 Mar 2022 20:26:36 GMT</pubDate><content:encoded><![CDATA[<p>Probably one of the more confusing properties to grasp when getting into CSS is the position property. The position property specifies the position of an element on a page or relative to some other element. It depends on the top, bottom, left, and right property values to determine the final position of the element. There are 5 values for the position property which includes:</p>
<pre><code>• <span class="hljs-attribute">position</span>: static;
• <span class="hljs-attribute">position</span>: absolute;
• <span class="hljs-attribute">position</span>: fixed;
• <span class="hljs-attribute">position</span>: relative;
• <span class="hljs-attribute">position</span>: sticky;
</code></pre><h3 id="heading-static-position-static">Static (position: static;)</h3>
<p>It is crucial to understand the static value to understand certain other values of the position property. The static value is the default value of any HTML element. With the static value, the element is not affected by the top, bottom, left, and right property values. The element is instead positioned according to the sequence/flow of the document which is how they are placed in the HTML file.</p>
<h3 id="heading-absolute-position-absolute">Absolute (position: absolute;)</h3>
<p>With position absolute, an element is removed from the document flow and is positioned absolutely either relative to its closest positioned ancestor ( a parent element that has a position other than static ) or absolutely relative to its containing block. For example, an element is contained in a parent element with a position value of relative and that element's position is set to absolute with a top of 0, the element's position would be at the very top of the parent element. In a scenario where the parent element is set at the default position of static and there exists no other positioned ancestor, the element would be positioned at the top of its containing block. </p>
<h3 id="heading-fixed-position-fixed">Fixed (position: fixed;)</h3>
<p>When the fixed value is used, the element is positioned relative to the <strong><em>viewport which is the visible portion of a page at any given time</em></strong>. The element stays in the same location on the page even when scrolling. Its position on the page is then dependent on the values of the top, bottom, left, and right properties. For example, when the value of the top property is set to say 40px, the element will always stay 40px from the top of the viewport.</p>
<h3 id="heading-relative-position-relative">Relative (position: relative;)</h3>
<p>When the relative value is used, the element’s position is set relative to its normal position on the page (basically static positioning with rights). With the relative value, the position of the element can then be set with top, bottom, left, and right properties. Say the value of left is set to 40px, the element is positioned 40px left from its normal position. The position set with the values of top, bottom, left, and/or right does not affect the position of other elements which might lead to it overflowing above other elements.</p>
<h3 id="heading-sticky-position-sticky">Sticky (position: sticky;)</h3>
<p>The more complex of the bunch; the sticky value is one that positions an element based on scroll action. It can be seen as a mix of relative and fixed positioning; the position of the element remains relative until it reaches a criterion at which point it then becomes fixed. The criteria to specify for position sticky to work is either a top, bottom, left, or right value. For example, if we were to set the position of an element to sticky and the top to 0, the element would act normally (relative positioning) up until the point when the top of the element touches the top of the view-port at which point the top value would in fact be 0 and then the element switches and becomes fixed to the top of the view-port. Something to note is that position sticky is not compatible with all browsers.</p>
<p><em>That's a wrap. Feel free to leave a comment or send me a DM on Twitter <a target="_blank" href="https://twitter.com/phemi_t">@Phemi_T</a> should you require further clarification</em>.</p>
]]></content:encoded></item></channel></rss>