Skip to content

Instantly share code, notes, and snippets.

@bartcis
Created May 12, 2019 14:02
Show Gist options
  • Select an option

  • Save bartcis/2980463ad90038ea9d4747347755df83 to your computer and use it in GitHub Desktop.

Select an option

Save bartcis/2980463ad90038ea9d4747347755df83 to your computer and use it in GitHub Desktop.
Sample calculation of Specificity
// 0-1-0 + 0-1-0 + 0-1-0 = 0-3-0
.form__field__input:placeholder-shown + .form__field__label {
color: red;
}
// 1-0-0 + 0-0-1 + 0-0-1 = 1-0-2
#wrapper ul li {
color: red;
}
// 0-1-0 + 0-0-0 + 0-0-1 + 0-0-1 + 0-1-0= 0-2-2
.form:not(div) input[name] {
color: red;
}
// 1-0-2 > 0-3-0 > 0-2-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment