Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/build/utils/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@ export function hyphenToCamelCase(name: string): string {
.replace(/-(\w)/g, (_, c) => c.toUpperCase());
return camel === "float" ? "_float" : camel;
}

export function camelToHyphenCase(name: string): string {
const dashPrefix = name.startsWith("webkit") ? "-" : "";
return dashPrefix + name.replace(/[A-Z]/g, (c) => "-" + c.toLowerCase());
}
13 changes: 0 additions & 13 deletions src/build/utils/fs.ts

This file was deleted.

9 changes: 4 additions & 5 deletions src/build/webref/css.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
function hyphenToCamelCase(name: string) {
const camel = name
.replace(/^-(\w)/, (_, c) => c)
.replace(/-(\w)/g, (_, c) => c.toUpperCase());
return camel === "float" ? "_float" : camel;
import { hyphenToCamelCase } from "../utils/css.js";
export function camelToHyphenCase(name: string): string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use this one, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I have updated it

const dashPrefix = name.startsWith("webkit") ? "-" : "";
return dashPrefix + name.replace(/[A-Z]/g, (c) => "-" + c.toLowerCase());
}

export function generateWebIdlFromCssProperties(properties: string[]): string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is webref specific and I'd rather keep it here. Maybe import the case conversion function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@saschanaz saschanaz Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, actually, the utils/css module is totally unused. Let's remove that and keep this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated it @saschanaz

Expand Down