Init Axo design system

This commit is contained in:
Jamie Kyle
2025-08-04 13:35:20 -07:00
committed by GitHub
parent 7553a85b1c
commit 0d99f8bca2
35 changed files with 4785 additions and 210 deletions

27
ts/axo/_internal/css.tsx Normal file
View File

@@ -0,0 +1,27 @@
// Copyright 2025 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export type Styles = string & { __Styles: never };
export function css(
...classNames: ReadonlyArray<Styles | string | boolean | null>
): Styles {
const { length } = classNames;
let result = '';
let first = true;
for (let index = 0; index < length; index += 1) {
const className = classNames[index];
if (typeof className === 'string') {
if (first) {
first = false;
} else {
result += ' ';
}
result += className;
}
}
return result as Styles;
}