Search
The Order of CSS Classes in HTML Doesn’t Matter
17.12.2019
That’s right! And I can prove it, too. Let’s look at some CSS first:
.a {
color: red;
}
.b {
color: blue;
}
And now let’s look at some markup:
<div class="a b">Here’s some text</div>
The text is going to be blue because .b is defined last in the CSS, right? But what if we...
What is super() in JavaScript?
6.11.2019
What's happening when you see some JavaScript that calls super()?.In a child class, you use super() to call its parent’s constructor and super.<methodName> to access its parent’s methods. This article will assume at least a little familiarity with the concepts of constructors and child...
Coinbase Study Says 56% of Top 50 Universities Have Crypto Classes
29.8.2019
Compared to last year, twice as many university students, or 18 percent, partook in a crypto or blockchain class
Contextual Utility Classes for Color with Custom Properties
14.8.2019
In CSS, we have the ability to access currentColor which is tremendously useful. Sadly, we do not have access to anything like currentBackgroundColor, and the color-mod() function is still a ways away.
With that said, I am sure I am not alone when I say I'd like to style some links based on...
CSS :not() with Multiple Classes
22.7.2019
Say you want to select an element when it doesn't have a certain class. That's what the :not() selector is for.
body:not(.home) {
}
But what if there are multiple classes you want to avoid?
There are no logical combinators with :not(), like and or or, but you can chain them, which...
Class Components in Vue are No Longer Happening
30.5.2019
An upcoming Vue update was set to have classes implemented. In React and Angular, we can create components u
A Better Approach for Using Purgecss with Tailwind
15.5.2019
Greg Kohn looks at how to use Purgecss — a tool that helps remove unused styles — and Tailwind — a utility-based CSS framework — and why we might want to pair these tools together:
Tailwind, by intention, is aiming to equip you with an arsenal of utility classes...
Could Grouping HTML Classes Make Them More Readable?
22.4.2019
You can have multiple classes on an HTML element:
<div class="module p-2"></div>
Nothing incorrect or invalid there at all. It has two classes. In CSS, both of these will apply:
.module { }
.p-2 { }
const div...
Tabs: It’s Complicated™
19.4.2019
I've said before one quick and powerful thing you can learn as a front-end developer just getting starting with JavaScript is changing classes.
const button = document.querySelector(".my-button");
const element = document.querySelector(".content");
button.addEventListener("click", function()...
Creating Reusable Base Classes in TypeScript with a Real-Life Example
18.4.2019
Hey CSS-Tricksters! Bryan Hughes was kind enough to take a concept from an existing post he published on converting to TypeScript and take it a few couple steps further in this post to elaborate on creating reusable base classes. While this post doesn’t require reading the other one, it’s certainly...
Using <details> for Menus and Dialogs is an Interesting Idea
21.3.2019
One of the most empowering things you can learn as a new front-end developer who is starting to learn JavaScript is to change classes. If you can change classes, you can use your CSS skills to control a lot on a page. Toggle a class to one thing, style it this way, toggle to another class...
Creating a Python Class Generator for VS Code
19.3.2019
My motto...when you have a problem, do something about. I hated stubbing out Python classes so I created an extension in Visual Studio Code to do it for me. In this article, let's walk through how
Accessibility is not a “React Problem”
11.3.2019
Leslie Cohn-Wein's main point:
While [lots of divs, inline styles, focus management problems] are valid concerns, it should be noted that nothing in React prevents us from building accessible web apps.
True. I'm quite capable (and sadly, guilty) of building inaccessible interfaces with React...
Did you know that CSS Custom Properties can handle images too?
27.2.2019
So you might be aware of CSS Custom Properties that let you set a variable, such as a theme color, and then apply it to multiple classes like this:
:root {
--theme: #777;
}
.alert {
background: var(—-theme);
}
.button {
background: var(—-theme);
}
Well, I had seen this pattern so often...
In Defense of Utility-First CSS
15.1.2019
A rather full-throated argument (or rather, response to arguments against) utility (atomic) CSS from Sarah Dayan. I wondered recently if redesigns were potentially a weakness of these types of systems (an awful lot of tearing down classes) which Sarah acknowledges and recommends more abstraction...