Skip to content

Use Semantic-UI css #71

@ghost

Description

Thanks for this great boilerplate project. I am trying to use Semantic-UI with it, but am having problems.

Semantic-UI consists of the semantic-ui-react package (containing components) and the Semantic-UI CSS, which you need to load separately. The components are working fine, but I cannot get the CSS to load.

Here's what I've tried:

  • adding <link rel="stylesheet" ...> to index.html; this just causes the page to go blank; the CSS loads successfully but the app does not load
  • import 'semantic-ui-css' in app.js; this gives me jQuery is not defined, as it needs jQuery
  • add the below into app.js; this avoids all errors but the CSS still does not get loaded into the page (i.e. my components appear but unstyled)
const jQuery = require('jquery');
document.jQuery = jQuery;
window.jQuery = jQuery;
require('semantic-ui-css');

There are no other errors that appear in the devtools console, and I'm a little stuck. Are you able to help me debug this? The alternative is to bring Webpack in and see if that helps; I'm resisting this as the app is meant to be lightweight and low-complexity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions