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.

Package documentation on npmjs.org: Clarify how to import the fiori-fundamentals SCSS file

See original GitHub issue

When I use create-react-app to create a new React app - which is the way how apps are created in the React tutorial:

npx create-react-app my-app
cd my-app
npm start

and I install fundamentals-react according to its documentation on npmjs.com

npm install --save fiori-fundamentals # fiori-fundamentals@1.4.1
npm install --save fundamental-react # fundamental-react@0.0.14

and I include the Fiori Fundamentals CSS in my React application by including the following lines at the top of the file src/App.css as stated on the package page:

$fd-icons-path: "~fiori-fundamentals/scss/icons/";
$fd-fonts-path: "~fiori-fundamentals/scss/fonts/";
@import '../node_modules/fiori-fundamentals/scss/all.scss';

then I get an error in my browser (Chrome version 71.0):

screenshot 2019-01-21 at 10 54 01

I’m playing the React.js rookie by following the documentation, please excuse me if this issue is trivial to solve…

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
CodesOfRacommented, Jan 21, 2019

hi @nhebling ,

I did a very tiny sample app for fundamental-react : https://github.com/CodesOfRa/fundamental-react-demo

You can check this one until we fix the documentation.

Let me know if it helps.

1reaction
PierreFritschcommented, Jan 21, 2019

It seems that mixing css and scss is not a good idea…

Renaming the file src/App.css to src/App.scss in the project generated by create-react-app did the trick for me.

I’d suggest to update the documentation on https://www.npmjs.com/package/fundamental-react so that other rookies won’t stumble here: Replace “In your App.css or App.scss file” with “In your App.scss file”.

screenshot 2019-01-21 at 12 59 34

By the way, shouldn’t the sentence below the code sample read “browse the components currently available with Fundamental React” instead of “Fundamental Vue”?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to import SASS through npm ? - GeeksforGeeks
First, download the latest version of a node in the system and install it. Now go to command prompt and address the folder...
Read more >
Importing Sass through npm - node.js - Stack Overflow
Then in your main scss file you can use: @import "~some-module/sass/app"; ... You can include the files from package using @import "my-cool-package/super- ...
Read more >
How to use SAP Fundamentals SCSS with Angular
Type npm install fiori-fundamentals --save-dev . This will install the package as a dev dependency. Verify the installation was successful by typing npm...
Read more >
import-scss - npm
Tool which imports new scss modules to your main scss file.. Latest version: 0.1.3, last published: 3 years ago. Start using import-scss in ......
Read more >
Beginner Guide to Vue.js With SAP Fiori Fundamental [Step ...
Detailed explanations are in the 'install section'. npm install --save fundamental-vue npm install --save fiori-fundamentals npm install sass- ...
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