Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
"scripts": {
"clean": "rm -rf dist",
"build": "yarn clean && concurrently 'yarn build-translations' 'vite build' 'tsc --project tsconfig.lib.json' 'yarn build-styling'",
"build-styling": "sass src/styling/index.scss:dist/css/index.css src/styling/_emoji-replacement.scss:dist/css/emoji-replacement.css src/plugins/Emojis/styling/index.scss:dist/css/emoji-picker.css src/plugins/ChannelDetail/styling/index.scss:dist/css/channel-detail.css src/plugins/AIComponents/styling/index.scss:dist/css/ai-components.css; cp -r src/styling/assets dist/css/assets",
"build-styling": "sass --no-charset src/styling/index.scss:dist/css/index.css src/styling/_emoji-replacement.scss:dist/css/emoji-replacement.css src/plugins/Emojis/styling/index.scss:dist/css/emoji-picker.css src/plugins/ChannelDetail/styling/index.scss:dist/css/channel-detail.css src/plugins/AIComponents/styling/index.scss:dist/css/ai-components.css; cp -r src/styling/assets dist/css/assets",
"build-translations": "node scripts/generate-i18n-keys.mts && prettier --write --log-level warn src/i18n/keys.ts",
"coverage": "vitest run --coverage",
"i18n:export": "node scripts/generate-i18n-keys.mts --json en.json",
Expand Down
2 changes: 2 additions & 0 deletions scripts/watch-styling.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ const flushQueuedBuild = () => {

const buildStyleEntry = async ({ entryFile, outputFile }) => {
const { css, sourceMap } = await compileAsync(entryFile, {
// Same as `--no-charset` in `build-styling`: `@charset` is invalid once imported into a layer.
charset: false,
sourceMap: true,
style: 'expanded',
});
Expand Down
7 changes: 5 additions & 2 deletions src/plugins/AIComponents/styling/_ai-ui-icons.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use 'sass:string';
@use './tokens' as *;

// The marks a reply's generated UI draws, the same in A2UI and OpenUI: glyphs and shapes in CSS,
Expand All @@ -21,7 +22,9 @@
content: $glyph;
}

// Non-ASCII glyphs stay CSS escapes in the output: Sass would otherwise write the characters
// themselves, so the stylesheet would decode right only as UTF-8 (it carries no `@charset`).
$ai-ui-glyph-info: 'i';
$ai-ui-glyph-success: '\2713';
$ai-ui-glyph-success: string.unquote('"\\2713"');
$ai-ui-glyph-warning: '!';
$ai-ui-glyph-danger: '\00d7';
$ai-ui-glyph-danger: string.unquote('"\\00d7"');
Loading