#gui

iced_style_config

Create Iced style sheets from configuration files

2 unstable releases

Uses new Rust 2021

0.2.0 Aug 5, 2022
0.1.0 Aug 5, 2022

#117 in GUI

Download history 62/week @ 2022-07-31 55/week @ 2022-08-07

117 downloads per month

Apache-2.0 OR MIT

125KB
3K SLoC

iced_style_config

crates.io docs.rs license rustc build status

Create Iced style sheets from configuration files.

Usage

Add this to your Cargo.toml:

[dependencies]
iced = "0.4"
iced_style_config = "0.1"

To disable hot reloading support:

[dependencies]
iced = "0.4"
iced_style_config = { version = "0.1", default-features = false }

Compiler support: requires the latest stable rustc

Examples

On native targets:

cargo run --example hot_reloading

On WebAssembly:

cargo build --target wasm32-unknown-unknown --example hot_reloading
wasm-bindgen target/wasm32-unknown-unknown/debug/examples/hot_reloading.wasm --out-dir hot_reloading --web
echo '<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Tour - Iced</title>
  </head>
  <body>
    <script type="module">
      import init from "./hot_reloading/hot_reloading.js";
      init("./hot_reloading/hot_reloading_bg.wasm");
    </script>
  </body>
</html>' > index.html
cargo run --example server

Note: Hot reloading on WebAssembly is not yet supported.

Schemas for configuration files

The schema.json is the JSON schemas for the configuration files, and when combined with an extension of the editor that supports completion using the JSON schema, completion can be enabled.

Visual Studio Code

In VS Code, you can enable completion and validation by installing the Even Better TOML extension and using the evenBetterToml.schema.associations configuration object in settings.json.

For example:

{
  "evenBetterToml.schema.associations": {
    ".*_theme\\.toml": "https://raw.githubusercontent.com/taiki-e/iced_style_config/main/schema.json",
  }
}

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~3–16MB
~304K SLoC