Forums

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

Home Forums CSS Clearing styles applied to IDs/Classes within IDs/Classes sharing the same name Re: Clearing styles applied to IDs/Classes within IDs/Classes sharing the same name

#108729

I just thought of using a mixin in sass/scss which is helpful so far but it assumes you have certain styles applied.

Check this out


@mixin clear($style) {
@if $style == 'clear-all' {
padding:0;
background-image:none;
background-color:transparent;
margin:0;
height:auto;
width:auto;
}
}


#selector
{
.form-item
{
height:470px;
max-width:470px;
width:100%;
float:left;
margin-right:25px;
margin-top:21px;
margin-left:10px;

.form-item
{
@include clear('clear-all');
}
}
}