babel-plugin-styled-components
babel-plugin-styled-components copied to clipboard
babel plugin which will change order of styled components
Hello, what do think about to create new plugin or add it to current plugin which will change order of styled components from:
const First = styled.div`
// ...
&:hover ${Second} {
opacity: 1;
}
`;
const Second = styled.div`
opacity: 0;
`;
to:
const Second = styled.div`
opacity: 0;
`;
const First = styled.div`
// ...
&:hover ${Second} {
opacity: 1;
}
`;
So plugin will check if some component included in previous component than it must be placed before it.
I can do such plugin by my self, I just want ask do it make sense for you?