Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Change colour but keeps same styles. Re: Change colour but keeps same styles.

#140588
TheDoc
Member

> is there a way so I only have .flat in once and then it applys to the rest so it is not too much repeating

If you’re just looking at saving a way for you to have to write it out, you’ll want to use Sass/Scss:

.flat {
height: 60px;
width: 150px;

&.red {
background: #bf3f3f;
}

&.pink {
background: #bf3fb4;
}

&.purple {
background: #963fbf;
}

&.blue {
background: #3f3fbf;
}
}