Skip to content
Open
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
22 changes: 21 additions & 1 deletion leptos_config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ use crate::errors::LeptosConfigError;
use config::{Case, Config, File, FileFormat};
use regex::Regex;
use std::{
env::VarError, fs, net::SocketAddr, path::Path, str::FromStr, sync::Arc,
env::VarError,
fs,
net::SocketAddr,
path::{Path, PathBuf},
str::FromStr,
sync::Arc,
};
use typed_builder::TypedBuilder;

Expand Down Expand Up @@ -166,6 +171,21 @@ impl LeptosOptions {
server_fn_mod_path: env_wo_default("SERVER_FN_MOD_PATH")?.is_some(),
})
}

/// Returns the path to the generated CSS file.
///
/// # Example
/// ```
/// let path = leptos_options.css_file_path();
/// println!("{}", path);
/// ```
pub fn css_path(&self) -> PathBuf {
let mut path = PathBuf::new();
path.push(&*self.site_pkg_dir);
let file_name = format!("{}.css", self.output_name);
path.push(file_name);
path
}
}

fn default_site_root() -> Arc<str> {
Expand Down
Loading