Compare commits
30 commits
103be9d13d
...
422e21aaf1
| Author | SHA1 | Date | |
|---|---|---|---|
|
422e21aaf1 |
|||
|
cee172fcc3 |
|||
|
db2d02a323 |
|||
|
ec2487fb5f |
|||
|
76cb98375c |
|||
|
30041c40c0 |
|||
|
fd11b2b7c4 |
|||
|
5e29de82eb |
|||
|
651b9ef3f0 |
|||
|
cabead92cf |
|||
|
7d886d2c24 |
|||
|
8129c5a6e7 |
|||
|
c18edc9146 |
|||
|
7a0a009ced |
|||
|
625077f341 |
|||
|
8bde7f8fc2 |
|||
|
1f966ad020 |
|||
|
349b51e76c |
|||
|
6233b46f70 |
|||
|
7d8ec5ffc1 |
|||
|
4a2136439f |
|||
|
957bc06f11 |
|||
|
84288c9660 |
|||
|
e40c66e399 |
|||
|
54fffa3c96 |
|||
|
72f06a4f2a |
|||
|
a2d233ed6d |
|||
|
f831e58723 |
|||
|
d73bb4580d |
|||
|
24b681453e |
4 changed files with 39 additions and 2 deletions
BIN
Cargo.lock
generated
BIN
Cargo.lock
generated
Binary file not shown.
|
|
@ -38,3 +38,6 @@ default = ["web"]
|
||||||
web = ["dioxus/web"]
|
web = ["dioxus/web"]
|
||||||
desktop = ["dioxus/desktop"]
|
desktop = ["dioxus/desktop"]
|
||||||
mobile = ["dioxus/mobile"]
|
mobile = ["dioxus/mobile"]
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
grass = "0.13"
|
||||||
|
|
|
||||||
33
crates/pinakes-ui/build.rs
Normal file
33
crates/pinakes-ui/build.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
#![expect(
|
||||||
|
clippy::expect_used,
|
||||||
|
reason = "build scripts conventionally panic on failure; there is no caller \
|
||||||
|
to propagate errors to"
|
||||||
|
)]
|
||||||
|
|
||||||
|
use std::{fs, path::Path};
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
// Compile SCSS to CSS
|
||||||
|
let scss_dir = Path::new("assets/styles");
|
||||||
|
let css_dir = Path::new("assets/css");
|
||||||
|
|
||||||
|
// Create CSS output directory if it doesn't exist
|
||||||
|
fs::create_dir_all(css_dir).expect("Failed to create CSS directory");
|
||||||
|
|
||||||
|
// Compile main.scss
|
||||||
|
let scss_input = scss_dir.join("main.scss");
|
||||||
|
let css_output = css_dir.join("main.css");
|
||||||
|
|
||||||
|
if scss_input.exists() {
|
||||||
|
let css = grass::from_path(
|
||||||
|
&scss_input,
|
||||||
|
&grass::Options::default().style(grass::OutputStyle::Compressed),
|
||||||
|
)
|
||||||
|
.expect("Failed to compile SCSS");
|
||||||
|
|
||||||
|
fs::write(&css_output, css).expect("Failed to write CSS");
|
||||||
|
|
||||||
|
// Tell cargo to rerun if SCSS files change
|
||||||
|
println!("cargo:rerun-if-changed=assets/styles");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
//! Styles module for Pinakes UI
|
//! Styles module for Pinakes UI
|
||||||
//!
|
//!
|
||||||
//! Exports the SCSS asset for use with Dioxus.
|
//! Exports the CSS asset for use with Dioxus.
|
||||||
|
//! SCSS files are compiled to CSS via build.rs.
|
||||||
|
|
||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
|
|
||||||
pub static STYLES: Asset = asset!("/assets/styles/main.scss");
|
pub static STYLES: Asset = asset!("/assets/css/main.css");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue