Skip to content

Instantly share code, notes, and snippets.

@david-lafontant
Last active January 31, 2022 23:56
Show Gist options
  • Save david-lafontant/7ef668cf2d9fe57130ce0fedd935e527 to your computer and use it in GitHub Desktop.
Save david-lafontant/7ef668cf2d9fe57130ce0fedd935e527 to your computer and use it in GitHub Desktop.
DRY evaluation
.cat {
font-family: "Times New Roman", Times, serif;
font-size: 1rem;
color: #FFF;
}
.dog {
font-family: "Times New Roman", Times, serif;
font-size: 1rem;
color: #000;
}
.dragon {
font-family: "Times New Roman", Times, serif;
font-size: 1rem;
color: #009933;
}
.greetings {
font-family: Arial, sans-serif;
font-size: 1.5rem;
}
.greetings.english {
background-color: #000;
color: #FFF;
}
.greetings.spanish {
background-color: #FFF;
color: #000;
}
@david-lafontant
Copy link
Author

david-lafontant commented Jan 31, 2022

example1.css is not DRY
To be DRY it could be :
animal{
font-family: "Times New Roman", Times, serif;
font-size: 1rem;
}

.cat {
color: #FFF;
}

.dog {
color: #000;
}

.dragon {
color: #009933;
}

@david-lafontant
Copy link
Author

example2.css is DRY
There is no redundancy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment