Skip to content

Commit 4af7127

Browse files
committed
feat(formatters): add SCSS formatter with routing and metadata updates
1 parent e5091fa commit 4af7127

10 files changed

Lines changed: 68 additions & 19 deletions

File tree

src/app/_services/route.service.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export class RouteService {
6161
name: 'CSS',
6262
title: 'CSS Formatter',
6363
url: '/format/css',
64+
description: 'Organize and beautify your CSS stylesheets with proper spacing and structure',
6465
loadComponent: () => import('../formatters/f-css/f-css.component').then((mod) => mod.FCssComponent),
6566
},
6667
{
@@ -71,6 +72,13 @@ export class RouteService {
7172
loadComponent: () =>
7273
import('../formatters/f-javascript/f-javascript.component').then((mod) => mod.FJavascriptComponent),
7374
},
75+
{
76+
name: 'SCSS',
77+
title: 'SCSS Formatter',
78+
url: '/format/scss',
79+
description: 'Format and beautify your SCSS/Sass code with proper indentation and structure.',
80+
loadComponent: () => import('../formatters/f-scss/f-scss.component').then((mod) => mod.FScssComponent),
81+
},
7482
],
7583
},
7684
{

src/app/app.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@
1212
</div>
1313
</div>
1414
</div>
15-
<div class="right-gutter"></div>

src/app/app.component.scss

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,10 @@ app-side-bar {
3636
// rgba(15, 15, 26, 0.95) 0%,
3737
// rgba(26, 26, 46, 0.9) 50%,
3838
// rgba(22, 33, 62, 0.95) 100%);
39-
min-width: 0;
39+
width: 280px;
40+
flex-shrink: 0;
4041
}
4142

42-
.right-gutter {
43-
// background: linear-gradient(180deg,
44-
// rgba(15, 15, 26, 0.95) 0%,
45-
// rgba(26, 26, 46, 0.9) 50%,
46-
// rgba(22, 33, 62, 0.95) 100%);
47-
min-width: 0;
48-
}
4943

5044
.middle-section {
5145
display: flex;
@@ -55,13 +49,10 @@ app-side-bar {
5549
width: 100%;
5650
position: relative;
5751
z-index: 1;
58-
margin-left: 280px;
52+
margin-left: auto;
53+
margin-right: auto;
5954
}
6055

61-
.left-gutter,
62-
.right-gutter {
63-
flex-grow: 1;
64-
}
6556

6657
.back {
6758
height: 100vh;
@@ -168,11 +159,9 @@ app-side-bar {
168159
@media (max-width: 1200px) {
169160
.middle-section {
170161
max-width: 100%;
171-
margin-left: 260px;
172162
}
173163

174-
.left-gutter,
175-
.right-gutter {
164+
.left-gutter {
176165
display: none;
177166
}
178167
}
@@ -186,7 +175,6 @@ app-side-bar {
186175
flex-direction: column;
187176
height: auto;
188177
min-height: 100vh;
189-
margin-left: 0;
190178
margin-top: 120px;
191179
}
192180

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Injectable } from '@angular/core';
2+
import * as prettier from 'prettier';
3+
import * as postcss from 'prettier/plugins/postcss';
4+
import { Observable, from } from 'rxjs';
5+
import { FormatViewService } from './sql-format.service';
6+
7+
@Injectable()
8+
export class ScssFormatService extends FormatViewService {
9+
override title = 'SCSS Formatter';
10+
override language = 'scss';
11+
override routeName = 'SCSS';
12+
override format(input: string): Observable<string> {
13+
return from(prettier.format(input, { parser: 'scss', plugins: [postcss] }));
14+
}
15+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:host {
2+
display: flex;
3+
flex-direction: column;
4+
flex-grow: 1; }
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { CommonModule } from '@angular/common';
2+
import { ChangeDetectionStrategy, Component } from '@angular/core';
3+
import { FormsModule } from '@angular/forms';
4+
import { ScssFormatService } from '../_services/scss-format.service';
5+
import { FormatViewService } from '../_services/sql-format.service';
6+
import { FormatViewComponent } from '../format-view/format-view.component';
7+
8+
@Component({
9+
selector: 'app-f-scss',
10+
providers: [{ provide: FormatViewService, useClass: ScssFormatService }],
11+
imports: [CommonModule, FormsModule, FormatViewComponent],
12+
template: `<app-format-view></app-format-view>`,
13+
styleUrl: './f-scss.component.css',
14+
changeDetection: ChangeDetectionStrategy.OnPush,
15+
})
16+
export class FScssComponent {}

src/app/formatters/format-view/format-view.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export class FormatViewComponent {
9090
json: 'json',
9191
sql: 'sql',
9292
css: 'css',
93+
scss: 'scss',
9394
javascript: 'js',
9495
yaml: 'yaml',
9596
};
@@ -101,6 +102,7 @@ export class FormatViewComponent {
101102
JSON: 'Beautify and validate your JSON data with proper indentation and formatting',
102103
SQL: 'Format SQL queries for better readability and consistency across your database code',
103104
CSS: 'Organize and beautify your CSS stylesheets with proper spacing and structure',
105+
SCSS: 'Format and beautify your SCSS/Sass code with proper indentation and structure',
104106
JavaScript: 'Clean up and format your JavaScript code with consistent indentation and style',
105107
YAML: 'Format YAML files with proper alignment and structure for configuration files',
106108
};

src/app/pages/welcome/welcome.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export class WelcomeComponent {
9494
'SQL': '🗃️',
9595
'JSON': '📋',
9696
'CSS': '🎨',
97+
'SCSS': '🎨',
9798
'JavaScript': '📜',
9899
'Json To Yaml': '🔄',
99100
'Base64': '🔐',

src/index.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<base href="/" />
77
<meta
88
name="keywords"
9-
content="online tools, json formatter, sql formatter, base64 encoder, yaml converter, time zones, css formatter, javascript formatter"
9+
content="online tools, json formatter, sql formatter, scss formatter, sass formatter, base64 encoder, yaml converter, time zones, css formatter, javascript formatter, code beautifier, developer tools"
1010
/>
1111
<meta name="robots" content="index, follow" />
1212
<meta name="author" content="Tim Dodd" />
@@ -16,6 +16,18 @@
1616
content="UtilPlex offers fast, no-fuss online tools for formatting JSON, SQL, CSS, JavaScript, converting JSON to YAML, and more."
1717
/>
1818
<meta name="viewport" content="width=device-width, initial-scale=1" />
19+
20+
<!-- Open Graph Meta Tags -->
21+
<meta property="og:title" content="UtilPlex | Free Online JSON Formatter, SQL Beautifier, YAML Converter" />
22+
<meta property="og:description" content="UtilPlex offers fast, no-fuss online tools for formatting JSON, SQL, CSS, JavaScript, converting JSON to YAML, and more." />
23+
<meta property="og:type" content="website" />
24+
<meta property="og:url" content="https://utilplex.com" />
25+
<meta property="og:site_name" content="UtilPlex" />
26+
27+
<!-- Twitter Card Meta Tags -->
28+
<meta name="twitter:card" content="summary_large_image" />
29+
<meta name="twitter:title" content="UtilPlex | Free Online JSON Formatter, SQL Beautifier, YAML Converter" />
30+
<meta name="twitter:description" content="UtilPlex offers fast, no-fuss online tools for formatting JSON, SQL, CSS, JavaScript, converting JSON to YAML, and more." />
1931
<link rel="icon" type="image/x-icon" href="favicon.ico" />
2032
<link
2133
rel="stylesheet"

src/sitemap.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
<loc>https://utilplex.com/format/json</loc>
2525
<lastmod>2025-06-17</lastmod>
2626
</url>
27+
<url>
28+
<loc>https://utilplex.com/format/scss</loc>
29+
<lastmod>2025-06-18</lastmod>
30+
</url>
2731
<url>
2832
<loc>https://utilplex.com/format/sql</loc>
2933
<lastmod>2025-06-17</lastmod>

0 commit comments

Comments
 (0)