The real CSS has landed

It’s took a while, but it finally feels like CSS has matured to what it originally promised.

Gone are the days of clearfixes and floats, let alone transparent PNG fixes and weird browser specific selectors! Remember having to use a * at the beginning of selectors to target IE6 and below? If you’re in a reminiscent mood, here are some more.

We often hear the phrase ‘good old days’. I am glad the good old days are behind us! Good riddance! I’m not a religious person, so to reference something from the Bible it has to be good! Ecclesiastes 7:10:

Do not say, “Why were the old days better than these?” For it is not wise to ask such questions.

Hello to a new era of CSS. It finally feels like it caters for our needs. The introduction of CSS calc, flexbox, nth child, just to name a few, are revealing the power of CSS and flexible layouts.

Responsive web design is what the web should have always been. Instead of mimicking other industries such as print, we’re now able to stand proud on our own two feet and innovate for a better web.

Internet Explorer is no longer a special case where we have to support several versions. Thanks to the introduction of other options, Internet Explorer’s majority has diluted down to a mediocre 12%, and that’s only if you include IE7 and IE8.

We often moan about the number of browsers on the market but it’s created a level playing field. For the most part they all behave the same. It’s forced browsers to keep up-to-date and include the new CSS features we’ve all been craving for. We can now focus on creating a better browsing experience instead of supporting quirky browsers.

The real web’s pretty awesome. I love real CSS.

CSS calc is more supported than media queries

Calc is awesome.

If you’ve not come across it in CSS, it allows you to do calculations. The big benefit is you can calculate across different units. It’s handy when building responsive websites. There are often times you need to calculate things like 20% – 1rem, well now you can! Here is an example:

The best bit is the support. Calc has better support than media queries, yes you read that right. Every browser including back to IE9 support it apart from Opera Mini.

Using SASS variables in Calc

You might try to include SASS variables inside calc and find they don’t work. The output in the CSS file with print exactly what was inside the calc function. If you include one it will print the variable name, not the value. After some digging I found you can wrap your variables so they work like anywhere else. It feels a little hacky but hey, it works!

Just one word of caution

When using it with pre-processors such as SASS or LESS you may start getting calc happy. Keep in mind if you’re calculating two values with the same units you can us your pre-processor. This will create cleaner and faster CSS. Just use calc when calculating two values with different units.

UPDATED 03/07/2015: Added using SASS variables inside calc

Sometimes you just need to write

To procrastinate as much as I have is a skill. It has to be, else I have a big personality deficiency. Starting a blog is hard, especially when you work in the industry and you’re a designer. My fixation on look causes me to down tools and run for the nearest dark closet.

Recently Phil Wylie said to me:

Sometimes you just need to write.

I’ve always had a fear of not knowing what to write about. I have lots of experience in the web industry but there is always a niggle that someone else has covered that topic better than I could.

I recently listened to Unfinished Business, a podcast hosted by Andy Clarke. On this particular episode Jeremy Keith spoke about writing a blog for your future self and not worrying about what others think.

The web industry is a fast paced place (say that after a few drinks). We’re continuously learning new things, writing them down serves three purposes:

  1. It helps us focus our thoughts.
  2. To help remember how to do things.
  3. It acts as a reference for our future selves.

I think setting goals are important. They give focus and targets to strive for. So here are my goals for this website:

  1. To express my personal opinions on topics.
  2. To experiment, learn and develop my skills.
  3. A reference for myself.
  4. A place to focus my thoughts, allowing me to think more rationally.
  5. To enable me to write more.

Sometimes you just need to write, so hello! I’m Dave and this is me writing.