-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"import 'bootstrap/dist/css/bootstrap.min.css';" doesn't work in the program #2519
Comments
To import CSS you need to import like this: In this case, you can import Bootstrap CSS from CDN on app.html |
Do I need to add some |
if you haven't deleted anyone, no. but you need to have a
|
In fact, I found that the Bootstrap could work if add this line of code in |
Could you please add this feature, which can support |
I also have this issue. @andreolibr In regards to:
How does that work for css classes with dashes in them? Because javascript cant use dashes, ie this doesnt work:
Even if there's a workaround to use those types of class names (which bootstrap has a lot of)
because bootstrap has a lot of class names that are optimized to be short, and relatively easy to remember. Basically it's nicer to write code like the above instead of:
|
I actually don't know how to override this style-name problem but I was searching on internet for a solution and came across with this: https://react-bootstrap.github.io/ It can become very useful for your problem. |
The solution is to import bootstrap in Here's an example of an app that's using react-bootstrap and importing bootstrap's SASS. |
@andreolibr @amilajack In the mean time I have also found that I can just copy the bootstrap.min.css file into the app.global.css file and it works as exepected. (ie I can do: Just curious but it seems the loading behavior of app.global.css is different than other css imports like: |
@nikita-skobov yea, checkout the webpack render config |
Hi, @nikita-skobov , so what is your favourite UI style framework now? |
Well I mainly just use bootstrap for its layouts Also, here's what I figured out about the css loading: In (Note the comments)
so anything marked as .global.css will be loaded as is. and otherwise it generates a unique name to avoid collisions: What I did is copied the bootstrap min css into my actual project folder, and renamed it to end in |
I tried using
import 'bootstrap/dist/css/bootstrap.min.css
to import Bootstrap, but this code doesn't work as,Prerequisites
master
branchDEBUG_PROD=true yarn build && yarn start
Note for using latest version of devtools:
The command for updating extensions version cannot work on Windows PowerShell, which need to be confirmed.
Note for link to stacktrace in a Gist (for bugs):
I am sorry for that, as a beginner, I don't know how to do that.
Expected Behavior
import 'bootstrap/dist/css/bootstrap.min.css
can work normally as,Current Behavior
import 'bootstrap/dist/css/bootstrap.min.css
seemed not to take effect, and it shows as,Possible Solution
Steps to Reproduce (for bugs)
Git clone the electron-react-boilerplate;
Install Bootstrap using
yarn add react-bootstrap bootstrap
;Change the code of HomePage.tsx as,
yarn dev
Context
This issue make me unable to use
import
to use import.css
file.Almost not.
Your Environment
The text was updated successfully, but these errors were encountered: