CSS custom properties (native variables) In-Depth

I thought to start from explaining the purpose of having variables in CSS but actually popularity of CSS pre/postprocessors already did that.

Couple examples:

  • color variables for branding
  • consistent components properties (layout, positioning etc.)
  • avoid code duplications

Yes, of course, you still can search and find/replace all you need manually in your codebase but it’s like not having variables in JS- pain. Having dynamic and scoped CSS variables provides even more abilities for your experiments and applications- you can read, set and update them on the fly! Also you can prevent code duplications around your codebase as recently Webkit guys did in their Web Inspector.

And finally you have an interface to easily pass data from CSS to JS (for example media breakpoint values).

Here is the short-list of features CSS properties have:

  • they are dynamic and can be changed at runtime
  • they are easily to read/write from JS
  • they inherit, cascade and have scopes

So let’s dive deeper what CSS properties are and how to use them.


Fish Shell- the missing config

After a long time using usual the Mac terminal I came to understanding that more advanced tool is needed for many common aspects of daily work.

For example: some commands autosuggestions which will remember your previous commands and be smart enough to repeat them depending on a situation. Another requirement from a UI-lover part of my soul- good syntax highlighting.

The best, if such tool wouldn’t require much time for setup and configuration to start working out of the box.

After some research I settled on 2 options: fish shell and Z shell (zsh). Either are worth and have their advantages/disadvantages.

I decided to try Fish Shell as one of my biggest requirements installation without need of long configuration. It’s really something Fish was designed for.


Native CSS Scroll Snap Points

Scrolling effects are increasingly popular these days.

Scroll snapping is used widely for a better separation of the provided content (vertical full height pages) or, for example, to emulate galleries behavior.

There are many popular plugins (fullPage.js, jQuery.panelSnap, jQuery Scrollify etc.) which provide such functionality.

Can you imagine how easy would be creating such effects using CSS only?

Meet the CSS Scroll Snap Points specification!