Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Commit 915848b

Browse files
author
Tynarus
authored
Merge pull request #12 from Tynarus/global-stylesheet
Global stylesheet
2 parents 3c0c3b4 + 492cbcd commit 915848b

File tree

7 files changed

+26
-18
lines changed

7 files changed

+26
-18
lines changed

config/build/webpack.common.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ module.exports = {
2727
},
2828
{
2929
test: /\.scss$/,
30-
exclude: /node_modules/,
31-
use: [ 'raw-loader', 'css-loader', 'sass-loader' ]
30+
exclude: [ /node_modules/, helpers.root('src', 'global.scss') ],
31+
use: [ 'raw-loader', 'sass-loader' ]
32+
},
33+
{
34+
test: helpers.root('src', 'global.scss'),
35+
use: [ 'style-loader', 'css-loader', 'sass-loader' ]
3236
},
3337
{
3438
test: /\.(png|jpe?g|gif|svg|woff|woff2|otf|ttf|eot|ico)$/,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"raw-loader": "^0.5.1",
5858
"reflect-metadata": "^0.1.10",
5959
"sass-loader": "^6.0.6",
60-
"style-loader": "^0.13.1",
60+
"style-loader": "^0.18.2",
6161
"tslint": "~5.7.0",
6262
"typescript": "~2.5.2",
6363
"webpack": "~3.4.1",

src/app/app.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<div class="tyn-app">
2+
<h1>App!</h1>
3+
24
<main>
35
<router-outlet></router-outlet>
46
</main>

src/app/app.component.scss

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
@import "../constants";
22

3-
html, body, h1 {
4-
margin: 0;
5-
padding: 0;
6-
}
7-
8-
body {
9-
background-color: $primary-bg;
10-
color: #ffffff;
11-
font-family: $primary-font;
12-
font-size: $primary-font-size;
13-
padding: 20px;
3+
h1 {
4+
color: purple;
145
}

src/app/app.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { Component, OnInit, ViewEncapsulation } from "@angular/core";
1+
import { Component, OnInit } from "@angular/core";
22

33
@Component({
44
selector: "tyn-app",
55
templateUrl: './app.component.html',
6-
styleUrls: [ "./app.component.scss" ],
7-
encapsulation: ViewEncapsulation.None
6+
styleUrls: [ "./app.component.scss" ]
87
})
98
export class AppComponent implements OnInit {
109

src/constants.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
$primary-color: #0064ff;
44
$primary-color-light: #3f86ff;
55

6-
$primary-bg: #373737;
6+
$primary-bg: #ffffff;
77
$primary-content-bg: #4b4b4b;
88

99
$primary-font: Tahoma, Arial, sans-serif;

src/global.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Global Application Styles
3+
*/
4+
5+
@import "constants";
6+
7+
body {
8+
background-color: $primary-bg;
9+
color: $primary-color;
10+
font-family: $primary-font;
11+
font-size: $primary-font-size;
12+
}

0 commit comments

Comments
 (0)