use super::*;
class! {
pub c_docs_code {
margin: "16px 0px";
border: format!("1px solid {}", var!(border));
border-radius: var!(radius-lg);
background: var!(muted);
overflow: "hidden";
pre {
margin: "0px";
padding: "16px";
border: "none";
border-radius: "0px";
background: "transparent";
color: var!(foreground);
font-family: var!(font-family-mono);
font-size: var!(font-xs);
line-height: "1.6";
overflow-x: "auto";
code {
display: "block";
margin: "0px";
padding: "0px";
border: "none";
background: "transparent";
color: "inherit";
font-family: "inherit";
font-size: "inherit";
line-height: "inherit";
white-space: "pre";
}
}
}
pub c_docs_code_header {
display: "flex";
align-items: "center";
justify-content: "space-between";
gap: "8px";
padding: "4px 8px";
border-bottom: format!("1px solid {}", var!(border));
background: var!(muted);
color: var!(muted-foreground);
font-family: var!(font-family-mono);
font-size: var!(font-xs);
line-height: "1.5";
}
pub c_docs_code_lang {
font-weight: "500";
overflow: "hidden";
text-overflow: "ellipsis";
white-space: "nowrap";
}
pub c_docs_code_copy {
display: "inline-flex";
align-items: "center";
flex-shrink: "0";
gap: "4px";
padding: "2px 8px";
border: format!("1px solid {}", var!(border));
border-radius: var!(radius-sm);
background: var!(background);
color: var!(foreground);
font-family: "inherit";
font-size: var!(font-xs);
line-height: "1.5";
cursor: "pointer";
transition: format!("background {} {}, color {} {}", var!(duration-fast), var!(ease-out), var!(duration-fast), var!(ease-out));
:hover {
background: var!(accent);
color: var!(accent-foreground);
}
}
pub c_docs_code_label {
display: "inline";
}
pub c_docs_code_label_hidden {
display: "none";
}
}
pub(crate) const COPY_LABEL: &str = "Copy";
pub(crate) const COPY_LABEL_CLASS: &str = "c_docs_code_label";
pub(crate) const HIDDEN_LABEL_CLASS: &str = "c_docs_code_label_hidden";
pub(crate) const LABEL_SELECTOR: &str = ".c_docs_code_label, .c_docs_code_label_hidden";
pub(crate) const COPY_BUTTON_SELECTOR: &str = ".c_docs_code_copy";
pub(crate) const RESTING_STATE: u8 = 0;
pub(crate) const COPY_STATE: u8 = 1;
pub(crate) const FAILED_STATE: u8 = 2;
pub(crate) const COPY_FEEDBACK_MILLIS: u32 = 2000;
pub(crate) const COPIED_LABEL: &str = "Copied";
pub(crate) const FAILED_LABEL: &str = "Failed";
pub(crate) const COPY_BUTTON_LABEL: &str = "Copy code to clipboard";