-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.scss files not processed from index.html #1787
Comments
can you copy and paste your component code? |
@PiusNyakoojo sass will not compile your styles when including them that way. you can only link stylesheets that way if they are static assets. In the current master of the cli you can point to a main stylesheet which can be sass. |
if you have a global static stylesheet you want to include you can put it in the public folder. Or if using master in src/assets |
I've tried to put a .scss file in the public folder, but on build it doesn't process it into a css file. |
see #1459 |
@sirajc Thanks. This PR addresses my concern: #1633 In short: When this request is merged to the main branch (when the angular-cli team releases the next version of the cli), we can add "styles": "our.style.scss" to angular-cli.json as part of the apps[0] metadata. Concretely:
|
Hello, If i create in [myproject]/src/app/style.scss this file is ignored by angular-cli and it's not compiled and published alongside the other files? Thanks for any clarifications! |
@kennyrulez here are a few things you could check 1. Did you create this project with
No? Then did you add sass support with
2. Is style.scss referenced in one of your components? // for example
@Component({
templateUrl: './app.component.html',
stylesUrl: ['./style.scss']
}) 3. Are you trying to style the body tag? For this, you may want to make the stylesheet global // reference your styles in angular-cli.json
"apps": [
{
// ... other stuff
"styles": [
"./src/style.scss" // reference your style sheet here
]
}
] Note: ng serve is just ng build + watching your files for changes then rebuilding and reloading page |
@PiusNyakoojo thanks for your response. Number 3 is exactly what i want to achieve.
and referenced in index.html as No way of getting it working. It seems is not compiling it nor bundling it. Thanks for your help! |
I hope you don't have mind to join to your conversation. My project is using sass and I want to create one scss file with all variable of my project (something like an global scss). When I am including this
Is it possible to have a |
See response by filipesilva in #1780.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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
ng new project-name --prefix pn
ng set defaults.styleExt scss
$bg-color: red;
ng serve
Version details:
OS: Windows 10
node: 6.3.1
angular-cli@1.0.0-beta.11-webpack.2
The text was updated successfully, but these errors were encountered: