use super::*;
class! {
pub c_docs_code {
margin: format!("{} 0", var!(space-lg));
border: format!("{} solid {}", var!(border-width), var!(border));
border-radius: var!(radius-lg);
background: var!(muted);
overflow: "hidden";
min-width: "0";
}
pub c_docs_code_pre {
:is(pre.c_docs_code_pre) {
margin: "0";
padding: var!(space-lg);
border: "none";
border-radius: "0";
box-shadow: "none";
background: "transparent";
color: var!(foreground);
font-family: var!(font-family-mono);
font-size: var!(font-xs);
line-height: "1.6";
white-space: "pre";
overflow-wrap: "normal";
overflow-x: "auto";
}
}
pub c_docs_code_content {
:is(code.c_docs_code_content) {
display: "block";
margin: "0";
padding: "0";
border: "none";
border-radius: "0";
box-shadow: "none";
background: "transparent";
color: "inherit";
font-family: "inherit";
font-size: "inherit";
line-height: "inherit";
white-space: "pre";
overflow-wrap: "normal";
}
}
pub c_docs_code_header {
display: "flex";
align-items: "center";
justify-content: "space-between";
gap: var!(space-sm);
padding: format!("{} {}", var!(space-xs), var!(space-sm));
border: "none";
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: var!(font-weight-medium);
overflow: "hidden";
text-overflow: "ellipsis";
white-space: "nowrap";
}
pub c_docs_code_copy {
display: "inline-flex";
align-items: "center";
flex-shrink: "0";
gap: var!(space-xs);
padding: format!("{} {}", var!(space-2xs), var!(space-sm));
border: "none";
border-radius: var!(radius-sm);
background: "transparent";
color: var!(foreground);
font-family: "inherit";
font-size: var!(font-xs);
line-height: "1.5";
cursor: "pointer";
: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";