ionic-framework: `global.scss` file from a newly created ionic2 app is not used to styling app

Short description of the problem:

global.scss file from a newly created ionic2 app is not used to styling app

But in this file appears:

// Global CSS
// --------------------------------------------------
// Put CSS rules here that you want to apply globally.

What behavior are you expecting?

The SASS styles should be applied.

Run ionic info from terminal/cmd prompt: (paste output below)

Cordova CLI: 6.2.0
Gulp version:  CLI version 1.2.1
Gulp local:  
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID: Ubuntu Description: Ubuntu 15.10 
Node Version: v4.4.3

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 8
  • Comments: 16 (4 by maintainers)

Commits related to this issue

Most upvoted comments

My workaround is to move src/theme/global.scss to src/app/app.scss and it should be compiled.

@Manduro yes moving the theme/global.scss to app/app.scss is the preferred solution since that file will get picked up because app.component.ts is the root module. I’ve updated the app-base to reflect this: https://github.com/driftyco/ionic2-app-base/commit/6bce14a580878745a80032da0c90715cda047952

Thanks for the heads up! PR made to fix this. https://github.com/driftyco/ionic-app-scripts/pull/41

@basvdijk Adding this at the end of theme/variables.scss worked for me: @import "./global";

Can someone from Ionic please update the changelog steps, and add the fact that global.scss is needed when migrating an existing project… Spent a lot of time trying to figure out where my site-wide styles should go 😦 Others seem to be confused as well. Thanks!

@Manduro’s suggestion works; but would much rather prefer Mike’s PR to be released soon since that would be the real way to do it I would think 😃