Skip to content

Commit

Permalink
Add some editor settings and base styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Hetty82 committed Apr 13, 2018
1 parent 63d384e commit c6307e3
Show file tree
Hide file tree
Showing 15 changed files with 115 additions and 39 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"tslint.autoFixOnSave": true,
"csscomb.preset": {
},
"csscomb.formatOnSave": false,

}
25 changes: 12 additions & 13 deletions src/app/core/components/layout/layout.component.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<header class="header">
<div class="container">
<div class="left">
<ng-content></ng-content>
</div>
<div class="left">
<h1 class="title">{{ title }}</h1>
<p>{{ subTitle }}</p>
</div>

<div class="center">
<a routerLink="/login" routerLinkActive="active">Login</a>
<a routerLink="/games" routerLinkActive="active">Games</a>
</div>

<div class="right">
<a routerLink="/login" routerLinkActive="active">Login</a>
<a routerLink="/games" routerLinkActive="active">Games</a>
</div>
<div class="right">
[ account ]
</div>
</header>

<main class="main">
<div class="container">
--/ router-outlet \--
<router-outlet></router-outlet>
--\ router-outlet /--
</div>
<router-outlet></router-outlet>
</main>
17 changes: 17 additions & 0 deletions src/app/core/components/layout/layout.component.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@import '~styles/variables'


.header
display: flex
align-items: center
margin-bottom: $spacing-xxl
padding: $spacing-sm $spacing-default
border-bottom: $border-light-double

.center
flex: 1
text-align: center

.title
font-size: $font-size-lg
margin-bottom: 0
4 changes: 3 additions & 1 deletion src/app/core/components/layout/layout.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Component, OnInit } from '@angular/core'
import { Component, OnInit, Input } from '@angular/core'

@Component({
selector: 'app-layout',
templateUrl: './layout.component.html',
styleUrls: ['./layout.component.sass']
})
export class LayoutComponent implements OnInit {
@Input() title: string
@Input() subTitle: string

constructor() { }

Expand Down
5 changes: 1 addition & 4 deletions src/app/core/containers/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
<app-layout>
<h1>Games</h1>
<h2>Made with Angular by hetty82</h2>
</app-layout>
<app-layout [title]="title" [subTitle]="subTitle"></app-layout>
3 changes: 2 additions & 1 deletion src/app/core/containers/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ import { Component } from '@angular/core'
styleUrls: ['./app.component.sass']
})
export class AppComponent {
title = 'app'
title = 'Games'
subTitle = 'Made with Angular by hetty82'
}
11 changes: 7 additions & 4 deletions src/app/core/containers/games/games.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<h2>Game list</h2>
<section class="container">
<h1 class="page-title">Game list</h1>

<ul>
<li *ngFor="let game of (games$ | async)">{{ game.name }}</li>
</ul>
</section>

<ul>
<li *ngFor="let game of (games$ | async)">{{ game.name }}</li>
</ul>
10 changes: 6 additions & 4 deletions src/app/core/containers/login/login.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<h2>User list</h2>
<section class="container">
<h1 class="page-title">User list</h1>

<ul>
<li *ngFor="let user of (users$ | async)">{{ user.name }}</li>
</ul>
<ul>
<li *ngFor="let user of (users$ | async)">{{ user.name }}</li>
</ul>
</section>
4 changes: 4 additions & 0 deletions src/styles/_layout.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.container
max-width: $container-max
margin: 0 auto
padding: 0 $spacing-default
13 changes: 11 additions & 2 deletions src/styles/_typography.sass
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ html
font-size: 16px

body
font-family: $font-family-sans
font-family: $font-family-default
font-size: 1em
line-height: 1.5
color: $text-color

h1,
h2,
h3
font-family: $font-family-serif
font-family: $font-family-special
margin-bottom: $spacing-default
font-weight: bold
line-height: 1.2
Expand All @@ -24,3 +25,11 @@ p
&:last-child
margin: 0

ul,
ol
margin: 0
padding: 0
list-style: none

.page-title
font-size: $font-size-xs
39 changes: 33 additions & 6 deletions src/styles/_variables.sass
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
@import url(https://fonts.googleapis.com/css?family=Ubuntu:400,400i,700,700i)
@import url(https://fonts.googleapis.com/css?family=Oswald:400,600)

$font-family-sans: Ubuntu, Verdana, Geneva, sans-serif
$font-family-serif: Georgia, serif
// fonts
$font-family-default: Ubuntu, Verdana, Geneva, sans-serif
$font-family-special: Oswald, sans-serif

$blue: lightblue
$font-size-xs: 0.75em
$font-size-sm: 0.875em
$font-size-default: 1em
$font-size-lg: 1.25em
$font-size-xs: 1.5em

$spacing-small: 0.5rem
$spacing-default: 1rem

$border-default: 1px solid #ddd
// colors
$blue: #00bfff

$gray-darker-1: #333333
$gray: #666666
$gray-lighter-1: #999999
$gray-lighter-2: #dddddd

// general
$spacing-sm: 0.5em
$spacing-default: 1em
$spacing-lg: 1.5em
$spacing-xl: 2em
$spacing-xxl: 3em

$border-default: 1px solid $gray
$border-light: 1px solid $gray-lighter-2
$border-light-double: 2px solid $gray-lighter-2

$border-radius: 3px

$container-max: 60rem

// color mapping
$text-color: $gray-darker-1

8 changes: 5 additions & 3 deletions src/styles/global.sass
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@import "reset"
@import "variables"
@import "typography"
@import 'reset'
@import 'variables'
@import 'mixins/index'
@import 'typography'
@import 'layout'

2 changes: 2 additions & 0 deletions src/styles/mixins/__index.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import 'layout'

4 changes: 4 additions & 0 deletions src/styles/mixins/_layout.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// =container
// max-width: $container-max
// margin: 0 auto
5 changes: 4 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
true,
"check-space"
],
"curly": true,
"curly": [
true,
"ignore-same-line"
],
"deprecation": {
"severity": "warn"
},
Expand Down

0 comments on commit c6307e3

Please sign in to comment.