background preloader

Design

Facebook Twitter

Supporting Dark Mode in Your Website. Working with and supporting dark mode is fun.

Supporting Dark Mode in Your Website

However, it's not just for fun, it's a feature, and some may even say it's a necessity. This post will focus on how I implemented dark mode support in this website. Click on the top right toggle on this page to see it in action. 😃 Here is the GitHub repo jec-11ty-starter if you prefer to read the code straightaway. What are the requirements? Our website needs to support dark and light mode. Here are the requirements:- Display the page with the user's preferred color scheme.

First things first, how to test this? Before we jump into coding, let's talk about how we can test color scheme changes. Here is the guide on how to change the color scheme in your system settings: However, changing our system settings multiple times is not fun. There are two ways to do this - the short version (if you remember the command) and a slightly longer version. Short version Slightly longer version Detecting user's preferred color scheme if (!

If (mode === DARK) { } } CSS and Scalability. Several years ago I got curious about how css worked at scale.

CSS and Scalability

When I first started out, there weren’t nearly as many learning resources as there are now. There were a few books that my friends lent me and a couple of decent blog posts. But CSS was still pretty new and most people hadn't started to think deeply or learn hard lessons about concepts of maintainability when working with teams on large web apps. CSS zen garden was a highly influential demo 'back in the day.' Most of my colleagues and I thought this did a perfect job at illustrating the power of the cascade.

In the beginning, that’s what people sold me as a feature. Patterns for Style Composition in React. While React is extremely flexible in terms of how you can structure your application’s UI, I’ve found that a few patterns for style composition have helped me keep things organized and easy to work with.

Patterns for Style Composition in React

These aren’t hard-and-fast rules, these are simply reflections on how I’ve come to organize components in apps that I’ve worked on. I’ve gravitated towards these patterns in an effort to: Create a well-defined visual design systemHelp maintain visual consistency across an applicationOnly deliver the CSS/styles needed to the client for a given UI – i.e. performanceIncrease the maintainability of visual stylesMake updates and iterations on styles easierMake legacy styles easier to deprecateCreate more readable componentsMake building out new UI easier and fasterKeep styles encapsulated to help prevent collisions and unwanted side effectsCreate an easy-to-use component API for non-front-end developers Stateless Functional UI Components render () { return ( <Input name='username' value={username} Font Awesome. The Ultimate Guide to CSS + Cheat Sheets □ - Level Up! - Medium. The Ultimate Guide to CSS + Cheat Sheets 📑 Bradley Nice Jul 16, 2018 · 4 min read by Bradley Nice, Content Manager at ClickHelp.com — professional technical writing tool CSS is a language that describes the style of an HTML document and its elements.

The Ultimate Guide to CSS + Cheat Sheets □ - Level Up! - Medium

How to get better at writing CSS - freeCodeCamp.org - Medium. Let’s not beat around the bush: writing great CSS code can be painful.

How to get better at writing CSS - freeCodeCamp.org - Medium

A lot of developers don’t want to do CSS development. I can do everything you want, but nah! No CSS. When I was building apps, CSS was the part I never enjoyed. But you can’t escape it, right? When beginning a project, all is working fine. Tabler/tabler-icons: A set of over 300 free MIT-licensed high-quality SVG icons for you to use in your web projects. Massilia Ipsum. UI Flat & Outline icons. Download free icons, music, stock photos, vectors. Positioning Elements on the Web. Choosing how to position an element in CSS is sometimes really a choice about what side effects are most acceptable.

Positioning Elements on the Web

Positioning layouts in CSS was once a very daunting task, and hacks like using tables for the entire layout were quite common. Over the years, the demand for better layout tools has led to steadily better support and techniques. Today we have options, and learning to manage each of these techniques is the key to creating complex layouts that remain easy to change and flexible enough to handle multiple screen sizes. Floats Floats are the most commonly used layout technique in CSS, but they can be frustrating if you don’t know how they affect their neighboring elements.

You can prevent an element from reflowing by giving it a clear property in your stylesheet. Because floated children will cause their parent elements to collapse, you will find yourself tempted to create new elements just to add clear: both and prevent this behavior. .container { @include clearfix; } Flexbox. 4 Rules for Intuitive UX – Learn UI Design. This is my advice on improving the UX of your designs WITHOUT hours of user research sessions, paper prototyping playtime, or any other trendy UX buzzwords.

4 Rules for Intuitive UX – Learn UI Design

(Seriously, search “design thinking”. 0 results. Nailed it!) Who’s this article for? I’m looking at you: Developers. If you’re already a UX designer, I don’t expect this article to go over super well with you. I call it “speaking interface”. When I started as a professional UX designer, I was shocked how many times my clients would hand me the initial wireframes (or the living, breathing, in-browser MVP) and there’d be completely obvious UX mistakes all over them. For lack of a better example: Dark Patterns.