What do you name color variables?

What naming scheme do you use for color variables?
Have you succeeded at writing CSS that uses color variables in a manner agnostic to the colors they represent?
I’ve tried all of the following, and I have yet to succeed at writing CSS that works well with any color scheme. ☹️

— Lea Verou (@LeaVerou) October 14, 2018

I remember the very first time I tried Sass on a project. The first thing I wanted to do was variablize my …

The post What do you name color variables? appeared first on CSS-Tricks.

Read more

Accessible SVG Icons With Inline Sprites

This is a great look at accessible SVG markup patterns by Marco Hengstenberg. Here’s the ideal example:

<button type="button">
Menu
<svg class="svg-icon"
role="img"
height="10"
width="10"
viewBox="0 0 10 10"
aria-hidden="true"
focusable="false">
<path d="m1 7h8v2h-8zm0-3h8v2h-8zm0-3h8v2h-8z"/>
</svg>
</button>

Notes:

  • It’s not the <svg> itself that is interactive — it’s wrapped in a <button> for that.
  • The .svg-icon class has some nice trickery, like em-based sizing to match the size of the text it’s next to, and currentColor to match the color.
  • Since

The post Accessible SVG Icons With Inline Sprites appeared first on CSS-Tricks.

Read more

100+ Christmas Mockups, Icons, Graphics & Resources

Christmas is on the way! Whether you’re designing festive party flyers, looking for Christmas mockups, or a holiday icon set, we have a great collection for you today! We’ve pulled together a fantastic collection of Christmas flyers and templates, mock-ups, icons, vectors, and much more. Some of them are completely free, some cost a few […]
Read more

Compound Components in React Using the Context API

Compound components in React allow you to create components with some form of connected state that’s managed amongst themselves. A good example is the Form component in Semantic UI React.

To see how we can implement compound components in a real-life React application, we’ll build a compound (multi-part) form for login and sign up. The state will be saved in the form component and we’ll put React’s Context AP to use to pass that state and the method from …

The post Compound Components in React Using the Context API appeared first on CSS-Tricks.

Read more

Edge’s Announcements

The public-consumption blog post:

Ultimately, we want to make the web experience better for many different audiences. People using Microsoft Edge (and potentially other browsers) will experience improved compatibility with all web sites, while getting the best-possible battery life and hardware integration on all kinds of Windows devices. Web developers will have a less-fragmented web platform to test their sites against, ensuring that there are fewer problems and increased satisfaction for users of their sites; and because we’ll continue …

The post Edge’s Announcements appeared first on CSS-Tricks.

Read more

Gutenberg is Here!

In January 2017, Matt Mullenweg announced the Gutenberg project. A project that would change the way people created websites and content in WordPress. After nearly two years, Gutenberg has been merged with core in WordPress 5.0. A long time coming The WISIWYG editor hasn’t had a massive update in over 15 years. Gutenberg introduces a …
The post Gutenberg is Here! appeared first on Torque.
Read more

Browser Diversity Commentary, Regarding the Edge News

Still no word from the horse’s mouth about the reported EdgeHTML demise, but I hear that’s coming later today. The blog posts are starting to roll in about the possible impact of this though.

Andre Garzia: While we Blink, we loose the Web:

Even though Opera, Beaker and Brave are all doing very good work, it is still Chrome engine behind them and that limits the amount of stuff they can build and innovate. It is like as …

The post Browser Diversity Commentary, Regarding the Edge News appeared first on CSS-Tricks.

Read more

5 Ways to Give Your Blog a Temporary Holiday Theme

It’s the most wonderful time of the year — for blogging. Give your blog a temporary holiday theme and meet your readers’ expectations for a bright and joyful time of year. Small changes make a significant impact on your site visitors, and WordPress makes it easy to add some seasonal cheer. Experts predict holiday eCommerce …
The post 5 Ways to Give Your Blog a Temporary Holiday Theme appeared first on Torque.
Read more