question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Classes not getting applied

See original GitHub issue

I’m not really sure if this is a Semantic issue or a React issue…so I am going to try here first. I’m running Semantic UI React in Electron. The issue I am seeing is the full style isn’t getting applied from classes. For example I am trying to load a Flag element:

        <div>
          Flag<br />
          <Flag name="us" />
        </div>

However, the CSS definitions for i.flag.us aren’t getting loaded:

screenshot 50

You can see that the sementic.css file is loaded, and the body styles have been applied, but not the i.flag.us styles. You can also see in the screenshot that this is happening for all the other styles as well (e.g. button). Any ideas?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
oullahcommented, Mar 19, 2017

I found a workaround. Instead of doing import 'semantic-ui-css/semantic.css', I copied semantic directly into my app and used a <link rel="stylesheet" href="./semantic/semantic.css"> tag instead. Would like to use the node module instead, any suggestions?

0reactions
SonataOtocommented, May 2, 2021

Super sorry to Necro this nearly 4 year old thread but I’ve run into the same thing today.

If I put import 'semantic-ui-css/semantic.min.css' into my index.tsx it isn’t respected by electron

But if I import the CSS in my index.html using:

<link
  async
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.1/dist/semantic.min.css"
/>
<script
  async
  src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.1/dist/semantic.min.js"
></script>

Electron will respect semantics css.

Hi! Sorry about re-open this issues.

( If this is with “Webpack” dependency! ) You need import your css from node_modules to another css file in your app. https://github.com/webpack-contrib/sass-loader#imports

Something like this:

File: project_root/src/App.global.css

Code: @import '~css-dependency/bootstrap.css';

Prepend a “~” to css file paths that are in your node_modules!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is my CSS style not being applied? - Stack Overflow
I went to solution explorer (press Ctrl+Alt+L) and searched gt.css (enter your css filename). Right click on your css filename and then on ......
Read more >
Why is my class not being applied? - Forums - CSS-Tricks
Try using the developer toolbar to select a button to see what selectors are already in use and take your cues from that....
Read more >
Solved: AEM style classes not getting applied in preview a...
Solved: Hi, I created a couple of CSS classes, where the author can apply those via style systems in a text component.
Read more >
Tailwind Classes not getting applied by javascript #7633
When I'm using tailwind classes like pointer-events-none in html , it is working properly . But when i want to add the same...
Read more >
Lesson 1: Understanding ID and Class in CSS
In this lesson you will learn how ID and Class attributes can be used to ... which tells the browser that the following...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found