<?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 Brett Nielsen on Medium]]></title>
        <description><![CDATA[Stories by Brett Nielsen on Medium]]></description>
        <link>https://medium.com/@rebelintents?source=rss-751b12836f53------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JOCmtq4BPceoNPIARb6D1Q.jpeg</url>
            <title>Stories by Brett Nielsen on Medium</title>
            <link>https://medium.com/@rebelintents?source=rss-751b12836f53------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 00:03:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rebelintents/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[Styling Form Elements]]></title>
            <link>https://medium.com/@rebelintents/styling-form-elements-d97559f11f41?source=rss-751b12836f53------2</link>
            <guid isPermaLink="false">https://medium.com/p/d97559f11f41</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Brett Nielsen]]></dc:creator>
            <pubDate>Tue, 12 Sep 2017 00:29:53 GMT</pubDate>
            <atom:updated>2017-09-12T00:29:53.745Z</atom:updated>
            <content:encoded><![CDATA[<p>Anyone who has worked with the various HTML form elements on a project will agree on one thing: they are a nightmare to style in CSS (sometimes). These semantic elements have a number of special properties and quirks that often make them respond unexpectedly to the styles we try to apply to them. The purpose of this blog post will be to provide a few tips and tricks for making the best of these limitations when styling form elements.</p><p>We’re going to cover a couple of the trickier form elements to style, starting with: text inputs. These elements are straightforward in their operation — they take text as an input from the user. However, until text is entered, they have a unique property in the form of a “placeholder”. This text can be seen in the example. It generally appears fainter than normal text and has it’s own style.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/224/1*BoqXW8ZDO5nD7jq1hZc4Yw.png" /></figure><p>If we wanted (for whatever reason) to have placeholder text that was 20px, blue and uppercase. We might try and style these as so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*8X472KZ8q9XUecIvT23r6w.png" /></figure><p>But, as we can see, only two of the three properties we’ve applied have stuck. Where’s the blue? This wasn’t quite the desired result. If targeting the input itself isn’t the way forward, what about the placeholder attribute itself? The way to do this is by using a double comma notation ::placeholder, similar to how ::after/::before pseudo-elements are targeted in CSS. Let’s try that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*TPXB93SIFHJC9hlcrlljXQ.png" /></figure><p>Different… but still not what we are looking for. The placeholder text is now taking the styles we’ve given it, but the input isn’t adjusting for the increased size. It’s taking its size only from what is passed directly to itself, not it’s placeholder attribute. In a case like this, a hybrid approach is needed to avoid these unwanted side effects:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*9TlIuPr01Cc37DjSOUUJLQ.png" /></figure><p>Other form elements that are notorious for being difficult to style are: checkboxes. Anyone who has worked with them will know it is tricky to get a desired appearance other than the browser default.</p><p>Let’s say we want a checkbox that really stands out, with a circular (instead of square) area, a pink background, cyan border and a purple checkbox. If we apply our CSS the standard way, we get the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*nY2b0jkAnq_VPfXPc4VoGA.png" /></figure><p>As we can see, none of the styling apart from height/width have been applied and the checkbox retains its generic appearance. However, there’s one CSS property that can change this — appearance: none.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*tJdEPOxaUSud5QyLysjegQ.png" /></figure><p>With the addition of just the one property, we’ve allowed the checkbox to take all the styles we had previously entered. Note that if you are using SCSS, a preprocessor will likely take care of the vendor prefixes for you, so all you need to remember is “appearance: none”. White the wording of the property might suggest that it removes the element from view entirely, what it actually does is much more useful. Setting appearance: none clear the browser’s default styling and allows you to override it with your own. It’s like an “on” switch for enabling styling of checkboxes and other difficult to style form elements.</p><p>There is one other thing we need to take care of before we finish. Note that appearance: none has removed the check <em>completely</em>. Not to worry, we wanted a custom checkmark anyway! You can have pretty much any icon be your checkmark, but in order to position it correctly, you’ll need to style the ::before or ::after pseudoelement of your checkbox. Let’s add the unicode star in our example (this should inherit the purple font colour we’ve set on the input. We’ll also need to use position: absolute to get the icon centered (don’t forget to add position: relative on the parent element!).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*LpeygItD5cuEiIpnd7YL2Q.png" /></figure><p>Voila! And those are my tips for styling just a couple of the form elements. There are many more, and some are more difficult to style than others. If you’re interested in further reading on the subject, I highly recommend the MDN article on HTML forms:</p><p><a href="https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Styling_HTML_forms">Styling HTML forms</a></p><p>See you in the next blog!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d97559f11f41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Quick Guide to the transform: scale Function in CSS]]></title>
            <link>https://medium.com/@rebelintents/a-quick-guide-to-the-transform-scale-function-in-css-a3b225d999d9?source=rss-751b12836f53------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3b225d999d9</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[graphic-design]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Brett Nielsen]]></dc:creator>
            <pubDate>Mon, 31 Jul 2017 16:28:17 GMT</pubDate>
            <atom:updated>2017-07-31T16:28:17.097Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m writing this blog post to provide a bit of a basis and background for a CSS property you may or may not yet be familiar with: transform: scale. In the past have used other transform functions in CSS such as translateX and translateY for desired styling, such as centering an element responsively within a parent div. But, what about a case where you are given a design that includes an element (either an image or something else) stylistically centered on a background element, but bleeding over the edges?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*osD18IU3_FIhEMwDxOlniQ.png" /></figure><p>As the image doesn’t find itself contained visually within the other div, in the past we might have made these sibling elements and used position: absolute to move the image into <em>just </em>the right place, pixel by pixel. I’m going to show a you a method that is much simpler using the transform: scale function. first things first, we set up our HTML as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*VprQASeMcuk3lPumO2CgAA.png" /></figure><p>Notice that we’re making the img element a child and not a sibling of the div element. This may seem counter-intuitive at first given the image is not contained withing the box in our example, but this is purely visual and doesn’t impact the basic structure of our site. Next, let’s give the div some styling so we can see it better:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*3A0slRXpbueKvp5Cz5INTQ.png" /></figure><p>If we take a look at where we currently are by opening our file in our browser, we’ll see that both elements align as we would expect parent and child to — at the top left, with our image covering the majority of our box’s background color.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*Oa5ZaK6VYVQj2p_iLMjbbg.png" /></figure><p>Now, to get from here to the desired result is simple once you know what transform: scale does. This function tells an element to extend (or contract) from where it is in relation to it’s parent element. It can do this along both the X or Y-axis. In fact, transform: scale in itself is a shortcut. Similarly to translateX or translateY, you can use scaleX and scaleY to adjust your element along the desired axis. In this case, we’ll just use the shortcut form.</p><p>Now, if we plug in a value to the function (say transform: scale(1.2)), we can see the effect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*NmERi2F-emaFV19E6Nil3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*b1je0scH2CEbZ3R8pnwQiA.png" /></figure><p>The image has extended over the edge of its parent div, but has done it in both directions evenly, giving us a nice centered effect. Now we just need some top margin in order to vertically center our image. Since the image we sourced has a height of 250px and our box has a set height of 350px, we can assume that a margin of 50px on top (half the pixel difference of 100) will vertically center the element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*ChebIyc3ditfsodH7eWs0Q.png" /></figure><p>And voila!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*osD18IU3_FIhEMwDxOlniQ.png" /></figure><p>Now we have a nicely centered, stylish image decoration for our document, without needing to mess with relative and absolute positioning! Stay tuned for more CSS tips and tricks in future…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3b225d999d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>