Today  i needed to find a way to target some html elements with css, based on the fact that this element would not have an inline attribute.

Long story short, here’s the line in question (sass): &:not([style*="background-color"])

The case’s scenario:

A features bloc in a blog, with 3 items. Each item can receive a picture as a background or a color and a transparent pattern. On top of the picture, i’d like to add an overlay to help the reading of the text. On the pattern not (for some design reasons).

Here’s a demo of the final effect (best seen on the jsfiddle site):

Basically i’m saying to the browser, if the block doesn’t have any background-color attribute, then create the pseudo element that will serve as a shadow for the text.

Note: images, patterns and colors would being added by some backend service with inline style.

Past Work

Soloteste

Design & development
Visit live site

Pousada Corsário

Design & development
Details Visit live site

Sydney Colombani

Design & development
Visit live site

Brecha

Development
Visit live site

Julia Queima

Design & development
Visit live site

Costa Brasilis

Design & Developement
Details

A3Interiores

Wp Development
Visit live site

ValorCafé e-commerce

Design
Details Visit live site

Oficina de Arquitetos

Development
Visit live site

Cani.tv

Development
Visit live site

Zee Champanheria

App design
Details

Rioow

Design & development
Details

ASBEA/RJ

Design & development
Details Visit live site

ValorCafé

Design & development
Details Visit live site

Livraria da Travessa

Design & development
Details Visit live site

Furafila

App design
Details

NETbureau

Design & development
Details Visit live site

About

So, i'm a developer from France currently living in Rio de Janeiro. I do code for the front-end side of the web with things like javascript, html, css, preprocessors, tasks runners, version control, frameworks, tdd, CI, Wordpress and others.

I do speak english, portuguese and french, read tons of books, love to play on a wake, bmx and snowboard and would like to travel to the Karakoram range, Tierra del Fuego and Mongolia.

I do appreciate you stopping by and admit i did abuse of the auxiliary verb do in this about.