Skip to content

Commit 7179603

Browse files
Bashamegasaschanaz
andauthored
Refactor CSS utility functions and remove unused files (#2217)
Co-authored-by: Kagami Sascha Rosylight <saschanaz@outlook.com>
1 parent 27f8b71 commit 7179603

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed

src/build/utils/css.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,3 @@ export function hyphenToCamelCase(name: string): string {
44
.replace(/-(\w)/g, (_, c) => c.toUpperCase());
55
return camel === "float" ? "_float" : camel;
66
}
7-
8-
export function camelToHyphenCase(name: string): string {
9-
const dashPrefix = name.startsWith("webkit") ? "-" : "";
10-
return dashPrefix + name.replace(/[A-Z]/g, (c) => "-" + c.toLowerCase());
11-
}

src/build/utils/fs.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/build/webref/css.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
function hyphenToCamelCase(name: string) {
2-
const camel = name
3-
.replace(/^-(\w)/, (_, c) => c)
4-
.replace(/-(\w)/g, (_, c) => c.toUpperCase());
5-
return camel === "float" ? "_float" : camel;
6-
}
1+
import { hyphenToCamelCase } from "../utils/css.js";
72

83
export function generateWebIdlFromCssProperties(properties: string[]): string {
94
return `partial interface CSSStyleProperties {${properties

0 commit comments

Comments
 (0)