Skip to content

.scss files not processed from index.html #1787

Closed
@PiusNyakoojo

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
[email protected]

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