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
6 changes: 6 additions & 0 deletions .changeset/wet-fans-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@devup-ui/wasm": patch
"@devup-ui/react": patch
---

Impl font-faces to global
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ jobs:
pnpm build
pnpm lint
# rust coverage issue
echo 'max_width = 1000' > .rustfmt.toml
echo 'max_width = 100000' > .rustfmt.toml
echo 'tab_spaces = 4' >> .rustfmt.toml
echo 'newline_style = "Unix"' >> .rustfmt.toml
echo 'fn_call_width = 1000' >> .rustfmt.toml
echo 'fn_call_width = 100000' >> .rustfmt.toml
echo 'fn_params_layout = "Compressed"' >> .rustfmt.toml
echo 'chain_width = 1000' >> .rustfmt.toml
echo 'chain_width = 100000' >> .rustfmt.toml
echo 'merge_derives = true' >> .rustfmt.toml
echo 'use_small_heuristics = "Default"' >> .rustfmt.toml
cargo fmt
Expand Down
62 changes: 32 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions apps/landing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"@devup-ui/reset-css": "workspace:*",
"@mdx-js/loader": "^3.1.0",
"@mdx-js/react": "^3.1.0",
"@next/mdx": "^15.4.4",
"@next/mdx": "^15.4.5",
"@types/mdx": "^2.0.13",
"body-scroll-lock": "3.1.5",
"clsx": "^2.1.1",
"next": "^15.4.4",
"next": "^15.4.5",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"react-markdown": "^10.1.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"react": "^19.1.1",
"react-dom": "^19.1.1",
"next": "^15.4.4",
"next": "^15.4.5",
"@devup-ui/react": "workspace:*"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions apps/rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"@devup-ui/react": "workspace:*"
},
"devDependencies": {
"@rsbuild/core": "^1.4.11",
"@rsbuild/plugin-react": "^1.3.4",
"@rsbuild/core": "^1.4.14",
"@rsbuild/plugin-react": "^1.3.5",
"@devup-ui/rsbuild-plugin": "workspace:*"
}
}
4 changes: 2 additions & 2 deletions benchmark/next-chakra-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"lint": "next lint"
},
"dependencies": {
"@chakra-ui/react": "^3.23.0",
"@chakra-ui/react": "^3.24.0",
"@emotion/react": "^11.14.0",
"next": "^15.4.4",
"next": "^15.4.5",
"next-themes": "^0.4.6",
"react": "^19.1.1",
"react-dom": "^19.1.1",
Expand Down
2 changes: 1 addition & 1 deletion benchmark/next-devup-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"react": "^19.1.1",
"react-dom": "^19.1.1",
"next": "^15.4.4",
"next": "^15.4.5",
"@devup-ui/react": "workspace:*"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/next-kuma-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"react": "^19.1.1",
"react-dom": "^19.1.1",
"next": "^15.4.4",
"next": "^15.4.5",
"@kuma-ui/core": "^1.5.9"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions benchmark/next-mui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"dependencies": {
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@mui/material": "7.2.0",
"next": "^15.4.4",
"@mui/material": "7.3.0",
"next": "^15.4.5",
"next-themes": "^0.4.6",
"react": "^19.1.1",
"react-dom": "^19.1.1",
Expand Down
3 changes: 3 additions & 0 deletions bindings/devup-ui-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ impl Output {
ExtractStyleValue::Import(st) => {
sheet.add_import(&st.file, &st.url);
}
ExtractStyleValue::FontFace(font) => {
sheet.add_font_face(&font.file, &font.properties);
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions libs/css/src/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ pub(super) static GLOBAL_STYLE_PROPERTY: phf::Map<&str, &[&str]> = phf_map! {
"objectPos" => &["object-position"],
"offsetPos" => &["offset-position"],
};
pub(super) static OPTIMIZE_MULTI_CSS_VALUE_PROPERTY: phf::Set<&str> = phf_set! {
"font-family",
"src",
"content",
"animation-name",
};

pub(super) static DOUBLE_SEPARATOR: phf::Set<&str> = phf_set! {
"after",
Expand Down
12 changes: 12 additions & 0 deletions libs/css/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pub mod class_map;
mod constant;
pub mod debug;
pub mod is_special_property;
pub mod optimize_multi_css_value;
pub mod optimize_value;
pub mod rm_css_comment;
mod selector_separator;
Expand Down Expand Up @@ -486,6 +487,17 @@ mod tests {
),
".cls:hover"
);

assert_eq!(
merge_selector(
"cls",
Some(&StyleSelector::Global(
"&".to_string(),
"file.ts".to_string()
))
),
"&"
);
}

#[test]
Expand Down
Loading