mirror of
https://github.com/coder/coder.git
synced 2026-11-02 21:50:08 +08:00
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:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user