Skip to content

.scss files not processed from index.html #1787

Description

@PiusNyakoojo

Bug Report

.scss files aren't processed to css when included via link tag in index.html

(this would be useful for global styles: e.g. styling the body as this doesn't seem to work in the default app.component.css)

Expected Behavior

.scss files are processed to css if they are included via a link tag in the index.html file.

Actual Behavior

.scss files aren't processed in index.html

Reproduction

  • Create a new project

ng new project-name --prefix pn

  • Add .scss support

ng set defaults.styleExt scss

  • Add link to index.html
<head>
<!-- other things -->

<!-- This could work if webpack were configured to check if theme.css exists; if not, then check for theme.scss and process that -->
<link rel="stylesheet" type="text/css" href="theme.css">


<!-- This doesn't work either.
<link rel="stylesheet" type="text/css" href="theme.scss">
-->
</head>
  • Create theme.scss
@import './variables'

body {
background-color: $bg-color;
}
  • Create variables.scss

$bg-color: red;

  • Serve

ng serve

Version details:

OS: Windows 10
node: 6.3.1
angular-cli@1.0.0-beta.11-webpack.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions