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
23 changes: 2 additions & 21 deletions Cargo.lock

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

40 changes: 35 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,22 @@ nohash-hasher = "0.2"
web-time = "1.1"
log = "0.4"
egui_kittest = { version = "0.37", optional = true }
pulldown-cmark = { version = "0.13.6", default-features = false, optional = true }
unicode-normalization = { version = "0.1.25", optional = true }

[features]
default = ["clipboard"]
default = [
"clipboard",
"fonts",
# keep sorted
"accordion",
"badge",
"dialog",
"disclosure",
"skeleton",
"spinner",
"tabs",
]
# The system clipboard, read on demand through `Shell::read_clipboard`.
# Without it, or on wasm, a read answers `ClipboardError::Unavailable`.
clipboard = ["dep:arboard"]
Expand All @@ -33,6 +46,20 @@ screenshots = ["dep:egui_kittest", "egui_kittest/wgpu", "dep:egui-wgpu", "dep:po
# Golden-image tests: kittest renders them on the screenshot path, so they need
# Mesa lavapipe. `cargo xtask snapshots` selects it.
snapshots = ["screenshots", "egui_kittest/snapshot"]
# The widgets beyond core's controls, each its own feature.
# keep sorted
accordion = ["disclosure"]
badge = []
command = ["dep:unicode-normalization"]
dialog = []
disclosure = []
form = []
hover-card = []
markdown = ["dep:pulldown-cmark"]
notify = []
skeleton = []
spinner = []
tabs = []

# The version egui-winit asks for, so the tree has the one arboard.
[target.'cfg(not(any(target_arch = "wasm32", target_os = "android", target_os = "ios")))'.dependencies]
Expand All @@ -57,9 +84,8 @@ eframe = "0.37"
egui_kittest = "0.37"
trybuild = "1"
# eggshell's own tests drive views through `testing::Driver`.
eggshell-ui = { path = ".", features = ["driver"] }
eggshell-ui-shadcn = { path = "crates/eggshell-ui-shadcn", features = ["extras"] }
eggshell-ui-extras = { path = "crates/eggshell-ui-extras", features = [
eggshell-ui = { path = ".", features = [
"driver",
# keep sorted
"accordion",
"badge",
Expand Down Expand Up @@ -89,7 +115,7 @@ harness = false
wasm-bindgen-futures = "0.4"

[workspace]
members = ["crates/eggshell-ui-shadcn", "crates/eggshell-ui-extras", "xtask"]
members = ["xtask"]

# clippy.toml's disallowed macros and methods are denied in library code by
# each library's crate attributes; tests, examples and benches may use them.
Expand All @@ -114,3 +140,7 @@ debug = "line-tables-only"
inherits = "dev"
debug-assertions = false
overflow-checks = false

[[example]]
name = "preset_dump"
required-features = ["badge", "command", "dialog", "disclosure", "form", "hover-card", "markdown", "notify", "skeleton"]
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,27 @@ so lavapipe is needed there too.
- `--filter NAME` runs only the goldens whose test name starts with `NAME` (they live in the `snapshots` module of the `it` test binary, so `NAME` is matched after `snapshots::`).
- `--clean` deletes the stray `.new.png` and `.diff.png` files.

## Fonts

With the default `fonts` feature the preset bundles **Geist**, shadcn's
default sans-serif, as one variable font, `src/fonts/Geist-Variable.ttf`
(`Geist[wght].ttf` from [vercel/geist-font](https://github.com/vercel/geist-font)
v1.9.2, 165 KiB). `Shadcn::apply` registers it at 400, 500, 600 and 700, so
`font_medium()`, `font_semibold()` and `font_bold()` draw real faces, and the
preset's buttons, labels and menu headings take shadcn's weights.

Geist is licensed under the SIL Open Font License 1.1; the licence is shipped
beside the font in [`src/fonts/OFL.txt`](src/fonts/OFL.txt) and applies to the font
file only. The crate's code is MIT.

- Swap the font with `Shadcn::with_fonts(Some(FontSet::variable(..)))` or
`FontSet::faces(..)` for static files, or keep egui's fonts with
`with_fonts(None)`.
- Leave it out with `default-features = false`: nothing is embedded, and
weights are drawn in the regular face with a debug warning.
- egui's own `default_fonts` feature embeds Ubuntu-Light, which Geist makes a
fallback only. Depend on egui with `default-features = false` to drop it.

## License

MIT
Expand Down
36 changes: 0 additions & 36 deletions crates/eggshell-ui-extras/Cargo.toml

This file was deleted.

60 changes: 0 additions & 60 deletions crates/eggshell-ui-extras/src/lib.rs

This file was deleted.

40 changes: 0 additions & 40 deletions crates/eggshell-ui-shadcn/Cargo.toml

This file was deleted.

25 changes: 0 additions & 25 deletions crates/eggshell-ui-shadcn/README.md

This file was deleted.

Loading
Loading