Erasmus2016/frontend

CSS in JavaScript

Closed this issue · 2 comments

Doe's it have an advantage to put the CSS into JavaScript string? The problem is that syntax highlighting and autocomplete doesn't work anymore. If it has any advantage would it be possible to just include a .css file and put the content into that variable?

Also the frontend guys had problems regarding static files. Is there a public path?

@marioim Syntax highlighting and autocomplete work for me (in Atom editor), so you can not say "it doesn't work" (WebStorm is not the center of the universe...) and IMHO saying that we should use different approach because of "syntax highlighting" is kind of dumb...

You can read more about styled-components here

But if you want, you can edit webpack config to support css (or scss) files. 👍

What do you mean by "static files"? If you mean things like images, you can use

import image from './image.png';
import styled from 'styled-components';

const Abc = styled.div`
  background-image: url(${image});
`;

I didn't said that we should do something different..? We are familiar with WebStorm because some of us use it everyday at work so...
If you are used to have autocomplete and it doesn't work it's a pain in the a**.