refactor(site): set square elements' dimensions with size- classes (#27071)

Finds all class combinations like `w-N h-N` and replaces them with
`size-N`.

- find: `/w-(\d+) h-\1(?=\s|")/g`, or `/h-(\d+) w-\1(?=\s|")/g`
- replace with: `size-$1`

The positive lookahead `/(?=\s|")/` matches whitespace or a double quote
character after the number, to prevent false matches where the numbers
aren't the same but share the same left digits:


https://github.com/coder/coder/blob/b3766d62be9487732c7e657cf737e739cc5413da/site/src/pages/WorkspacesPage/WorkspacesTable.tsx#L124

Unfortunately we don't have a way to automatically enforce this, since
there's no Biome equivalent for `eslint-plugin-tailwindcss`'s
[`enforces-shorthand`
rule](https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/HEAD/docs/rules/enforces-shorthand.md)
This commit is contained in:
Andrew Aquino
2026-07-07 15:50:58 -07:00
committed by GitHub
parent 14767dfa8e
commit 94605fa193
48 changed files with 71 additions and 71 deletions
@@ -45,9 +45,9 @@ export const CodeExample: FC<CodeExampleProps> = ({
? "Hide sensitive data"
: "Show sensitive data";
const icon = showFullValue ? (
<EyeOffIcon className="h-4 w-4" />
<EyeOffIcon className="size-4" />
) : (
<EyeIcon className="h-4 w-4" />
<EyeIcon className="size-4" />
);
return (