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.

External sass file(bootstrap)

See original GitHub issue

I am trying to port one of my sapper app over and run into a bit of a problem with external sass file

In my sapper project, I add

  :global {
    @import '../style/global.scss';

to the layout component. I tried to do the same thing in this template and it works. However, the style is inline inside the html instead of extracted to a separate file like sapper.

Is there a way to achieve the same behavior with this template.

Thank you

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

nickreesecommented, Sep 8, 2020

@dephiros Currently there are 2 rollup configs generated during dev mode and 2 during production. They differ quiet a bit.

— edit: But, the nice thing is that they are encapsulated in the createSSRConfig function in the rollup.config.js.

You should be able to adapt this pretty easily for production, but the bundling during development is quiet different.

— /edit

I’d find a template where someone was doing what you’re looking to do with the generic svelte rollup then:

  1. Figure out how they’re getting their css written to a file.
  2. Merge that pattern in on the server versions of the Elder.js rollup file.
  3. Include that written CSS into your public folder
  4. Include that css in your template.

I’d agree that this should be configurable, but it hasn’t made it on our priority list for so I haven’t built it yet.

nickreesecommented, Sep 8, 2020

@dephiros I completely misread your first comment. Yep, that is how it is configured. CSS from within Svelte components are written to the head of the page. This could be something we can rework in the future if someone wanted to spearhead it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sass · Bootstrap v5.0
Utilize our source Sass files to take advantage of variables, maps, mixins, and functions to help you build faster and customize your project....
Read more >
How to import and customize bootstrap with @use in SASS ...
The below customBootstrap.scss can then be imported into your main index.scss file, since bootstrap will be forwarded only by using @forward ...
Read more >
Getting it right with Sass and Bootstrap 5 - The Coding Machine
Bootstrap package will ship with all its source code, and for the styling part, it is all written in Sass. There is a...
Read more >
SASS Editing - Bootstrap Studio
SASS (opens new window) is a popular CSS extension language. It gives you variables, nesting, mixins, partials and more, which help you reuse...
Read more >
Learn Bootstrap 5 and SASS by Building a Portfolio Website
Learn Bootstrap 5 and Sass by building a portfolio website. Bootstrap is one of the most popular CSS frameworks and Sass is one...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found