mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 21:03:03 -05:00
refactor: move libs
This commit is contained in:
36
apps/angular/13-highly-customizable-css/.eslintrc.json
Normal file
36
apps/angular/13-highly-customizable-css/.eslintrc.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"extends": ["../../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"rules": {
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "attribute",
|
||||
"prefix": "app",
|
||||
"style": "camelCase"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/component-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "element",
|
||||
"prefix": "app",
|
||||
"style": "kebab-case"
|
||||
}
|
||||
]
|
||||
},
|
||||
"extends": [
|
||||
"plugin:@nx/angular",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
]
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@nx/angular-template"],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
13
apps/angular/13-highly-customizable-css/README.md
Normal file
13
apps/angular/13-highly-customizable-css/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Highly Customizable CSS
|
||||
|
||||
> author: thomas-laforge
|
||||
|
||||
### Run Application
|
||||
|
||||
```bash
|
||||
npx nx serve angular-highly-customizable-css
|
||||
```
|
||||
|
||||
### Documentation and Instruction
|
||||
|
||||
Challenge documentation is [here](https://angular-challenges.vercel.app/challenges/angular/13-styling/).
|
||||
75
apps/angular/13-highly-customizable-css/project.json
Normal file
75
apps/angular/13-highly-customizable-css/project.json
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"name": "angular-highly-customizable-css",
|
||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "application",
|
||||
"sourceRoot": "apps/angular/13-highly-customizable-css/src",
|
||||
"prefix": "app",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@angular-devkit/build-angular:browser",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"options": {
|
||||
"outputPath": "dist/apps/angular/13-highly-customizable-css",
|
||||
"index": "apps/angular/13-highly-customizable-css/src/index.html",
|
||||
"main": "apps/angular/13-highly-customizable-css/src/main.ts",
|
||||
"polyfills": ["zone.js"],
|
||||
"tsConfig": "apps/angular/13-highly-customizable-css/tsconfig.app.json",
|
||||
"inlineStyleLanguage": "scss",
|
||||
"assets": [
|
||||
"apps/angular/13-highly-customizable-css/src/favicon.ico",
|
||||
"apps/angular/13-highly-customizable-css/src/assets"
|
||||
],
|
||||
"styles": ["apps/angular/13-highly-customizable-css/src/styles.scss"],
|
||||
"scripts": []
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
"maximumWarning": "500kb",
|
||||
"maximumError": "1mb"
|
||||
},
|
||||
{
|
||||
"type": "anyComponentStyle",
|
||||
"maximumWarning": "2kb",
|
||||
"maximumError": "4kb"
|
||||
}
|
||||
],
|
||||
"outputHashing": "all"
|
||||
},
|
||||
"development": {
|
||||
"buildOptimizer": false,
|
||||
"optimization": false,
|
||||
"vendorChunk": true,
|
||||
"extractLicenses": false,
|
||||
"sourceMap": true,
|
||||
"namedChunks": true
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"serve": {
|
||||
"executor": "@angular-devkit/build-angular:dev-server",
|
||||
"configurations": {
|
||||
"production": {
|
||||
"buildTarget": "angular-highly-customizable-css:build:production"
|
||||
},
|
||||
"development": {
|
||||
"buildTarget": "angular-highly-customizable-css:build:development"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "development"
|
||||
},
|
||||
"extract-i18n": {
|
||||
"executor": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"buildTarget": "angular-highly-customizable-css:build"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint"
|
||||
}
|
||||
},
|
||||
"tags": []
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
import { Component } from '@angular/core';
|
||||
import { TextStaticComponent } from './static-text.component';
|
||||
import { TextComponent } from './text.component';
|
||||
|
||||
@Component({
|
||||
selector: 'page',
|
||||
standalone: true,
|
||||
imports: [TextStaticComponent, TextComponent],
|
||||
template: `
|
||||
<static-text></static-text>
|
||||
<static-text type="error"></static-text>
|
||||
<static-text type="warning"></static-text>
|
||||
<text [font]="15" color="blue">This is a blue text</text>
|
||||
`,
|
||||
})
|
||||
export class PageComponent {}
|
||||
@@ -0,0 +1,33 @@
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { TextComponent } from './text.component';
|
||||
|
||||
export type StaticTextType = 'normal' | 'warning' | 'error';
|
||||
|
||||
@Component({
|
||||
selector: 'static-text',
|
||||
standalone: true,
|
||||
imports: [TextComponent],
|
||||
template: `
|
||||
<text [font]="font" [color]="color">This is a static text</text>
|
||||
`,
|
||||
})
|
||||
export class TextStaticComponent {
|
||||
@Input() set type(type: StaticTextType) {
|
||||
switch (type) {
|
||||
case 'error': {
|
||||
this.font = 30;
|
||||
this.color = 'red';
|
||||
break;
|
||||
}
|
||||
case 'warning': {
|
||||
this.font = 25;
|
||||
this.color = 'orange';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
font = 10;
|
||||
color = 'black';
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
import { Component, Input } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'text',
|
||||
standalone: true,
|
||||
template: `
|
||||
<p style="font-size: {{ font }}px; color: {{ color }}">
|
||||
<ng-content></ng-content>
|
||||
</p>
|
||||
`,
|
||||
})
|
||||
export class TextComponent {
|
||||
@Input() font = 10;
|
||||
@Input() color = 'black';
|
||||
}
|
||||
BIN
apps/angular/13-highly-customizable-css/src/favicon.ico
Normal file
BIN
apps/angular/13-highly-customizable-css/src/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
13
apps/angular/13-highly-customizable-css/src/index.html
Normal file
13
apps/angular/13-highly-customizable-css/src/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Styling</title>
|
||||
<base href="/" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
||||
</head>
|
||||
<body>
|
||||
<page></page>
|
||||
</body>
|
||||
</html>
|
||||
4
apps/angular/13-highly-customizable-css/src/main.ts
Normal file
4
apps/angular/13-highly-customizable-css/src/main.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
import { PageComponent } from './app/page.component';
|
||||
|
||||
bootstrapApplication(PageComponent).catch((err) => console.error(err));
|
||||
1
apps/angular/13-highly-customizable-css/src/styles.scss
Normal file
1
apps/angular/13-highly-customizable-css/src/styles.scss
Normal file
@@ -0,0 +1 @@
|
||||
/* You can add global styles to this file, and also import other style files */
|
||||
10
apps/angular/13-highly-customizable-css/tsconfig.app.json
Normal file
10
apps/angular/13-highly-customizable-css/tsconfig.app.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../../dist/out-tsc",
|
||||
"types": []
|
||||
},
|
||||
"files": ["src/main.ts"],
|
||||
"include": ["src/**/*.d.ts"],
|
||||
"exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["src/**/*.ts"],
|
||||
"compilerOptions": {
|
||||
"types": []
|
||||
}
|
||||
}
|
||||
29
apps/angular/13-highly-customizable-css/tsconfig.json
Normal file
29
apps/angular/13-highly-customizable-css/tsconfig.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2022",
|
||||
"useDefineForClassFields": false,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"noImplicitOverride": true,
|
||||
"noPropertyAccessFromIndexSignature": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.app.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.editor.json"
|
||||
}
|
||||
],
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableI18nLegacyMessageIdFormat": false,
|
||||
"strictInjectionParameters": true,
|
||||
"strictInputAccessModifiers": true,
|
||||
"strictTemplates": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user