linaria icon indicating copy to clipboard operation
linaria copied to clipboard

Benefits over CSS Modules

Open justincy opened this issue 4 years ago • 2 comments

Describe the enhancement

The Benefits doc is very helpful. It'd be nice to also have a section that explores the advantages of linaria over CSS Modules.

justincy avatar Apr 08 '21 20:04 justincy

@justincy from what I understand so far, Linaria works exactly like css modules + the advantage of Javascript expressions inside your css + automatic props -> css variables binding for expressions that rely on the React component props. So it has all the features of css modules + the additional benefit of js expressions.

DominikGuzei avatar Apr 22 '21 09:04 DominikGuzei

also css-modules blackboxes your code, which is its major problem. This means you can't expose sub parts of your component and other components can't style your component.

another benefit is type safety. there is no way to verify correct css variables are used.

KutnerUri avatar Sep 13 '21 20:09 KutnerUri