Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Duplicate CSS selectors not returned int result #93

Open
viveksachdeva opened this issue Apr 15, 2015 · 1 comment · May be fixed by #95
Open

Duplicate CSS selectors not returned int result #93

viveksachdeva opened this issue Apr 15, 2015 · 1 comment · May be fixed by #95

Comments

@viveksachdeva
Copy link

Code Snippet:

div.main {
width : 100%;
}

div.main {
background : white;
}

Expected output:
These two rules should be merged to one.

Actual output:
Nothing.

@chris-dura
Copy link

@viveksachdeva -- if these rules are in the same *.scss file, you might be able to solve your scenario with SCSS Lint.

However, I think this would still be an excellent enhancement, because I've recently taken over a codebase where someone, for some reason, duplicated a large amount of SCSS rules in the codebase (probably some sort of copy+paste error, or just ignorance). So, now the generated CSS is akin to this:

// line 101
.widget {
   color: red;
   width: 100px;
}

...

// line 3571
.widget {
   color: red;
   width: 100px;
}

There's some tools out there that will remove redundant CSS in the .css file, but I need to get rid of the extra rule definition all together in my .scss files. So, even just getting output which tells me what the duplicate selectors are would be extremely helpful!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants