Skip to content

Commit

Permalink
basic SVG demo
Browse files Browse the repository at this point in the history
  • Loading branch information
teropa committed Nov 25, 2016
1 parent d7b1c44 commit eba960e
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 8 deletions.
4 changes: 2 additions & 2 deletions angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"prefix": "app",
"mobile": false,
"styles": [
"styles.sass"
"styles.scss"
],
"scripts": [],
"environments": {
Expand All @@ -41,7 +41,7 @@
}
},
"defaults": {
"styleExt": "sass",
"styleExt": "scss",
"prefixInterfaces": false,
"inline": {
"style": false,
Expand Down
11 changes: 8 additions & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<h1>
{{title}}
</h1>
<h1>SVG</h1>

<h2>Basic SVG support</h2>

<p>You can just put an <code>&lt;svg&gt;</code> tag in a component and go to town. You can also style the SVG stuff using component styles.</p>

<app-basic-logo>
</app-basic-logo>
File renamed without changes.
3 changes: 1 addition & 2 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.sass']
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'app works!';
}
4 changes: 3 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { BasicLogoComponent } from './basic-logo/basic-logo.component';

@NgModule({
declarations: [
AppComponent
AppComponent,
BasicLogoComponent
],
imports: [
BrowserModule
Expand Down
8 changes: 8 additions & 0 deletions src/app/basic-logo/basic-logo.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<svg viewBox="0 0 250 250">
<g>
<polygon class="left" points="125,30 125,30 125,30 31.9,63.2 46.1,186.3 125,230 125,230 125,230 203.9,186.3 218.1,63.2" />
<polygon class="right" points="125,30 125,52.2 125,52.1 125,153.4 125,153.4 125,230 125,230 203.9,186.3 218.1,63.2 125,30" />
<path class="a" d="M125,52.1L66.8,182.6h0h21.7h0l11.7-29.2h49.4l11.7,29.2h0h21.7h0L125,52.1L125,52.1L125,52.1L125,52.1
L125,52.1z M142,135.4H108l17-40.9L142,135.4z"/>
</g>
</svg>
12 changes: 12 additions & 0 deletions src/app/basic-logo/basic-logo.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
svg {
max-width: 300px;
}
.left {
fill:#DD0031;
}
.right {
fill:#C3002F;
}
.a {
fill:#FFFFFF;
}
9 changes: 9 additions & 0 deletions src/app/basic-logo/basic-logo.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-basic-logo',
templateUrl: './basic-logo.component.html',
styleUrls: ['./basic-logo.component.scss']
})
export class BasicLogoComponent {
}
File renamed without changes.

0 comments on commit eba960e

Please sign in to comment.