Skip to content

Commit

Permalink
remove light css
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaoboy committed Sep 16, 2024
1 parent 6774bf0 commit cdca34b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 37 deletions.
2 changes: 1 addition & 1 deletion ansi2-wasm/src-ts/wasm/index.js

Large diffs are not rendered by default.

17 changes: 1 addition & 16 deletions ansi2/src/css.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ opacity: 0;

let root_css = format!(
r#"
:root {{color-scheme: light dark;}}
:root {{color-scheme: light dark; background-color: {light_bg_color}}}
{light_color_css}
{bg_light_color_css}
{default_light_text_style}
Expand All @@ -179,27 +179,12 @@ opacity: 0;
.trim()
.to_string();

let light_css = format!(
r#"
@media (prefers-color-scheme: light) {{
:root {{background-color: {light_bg_color}}}
{light_color_css}
{bg_light_color_css}
{default_light_text_style}
}}
"#
)
.trim()
.to_string();

format!(
r#"
{root_css}
{dark_css}
{light_css}
{common_style}
"#,
)
Expand Down
13 changes: 2 additions & 11 deletions ansi2/src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,10 @@ pub fn to_html<S: AsRef<str>>(
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
{font_style}
{style}
.ansi-main{{
display: flex;
flex-direction: column;
}}
.row{{
display: flex;
}}
.ansi-main{{display:flex;flex-direction:column;}}
.row{{display: flex;}}
.char{{
margin: 0;
padding: 0;
Expand Down
13 changes: 6 additions & 7 deletions ansi2/src/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,14 @@ height="{svg_h}px"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<style>
tspan {{
font-variant-ligatures: none;
dominant-baseline: central;
font-variant-ligatures: none;
white-space: pre;
font-family: ansi2-custom-font, Courier, monospace;
font-size: {fn_h}px;
font-variant-ligatures: none;
dominant-baseline: central;
font-variant-ligatures: none;
white-space: pre;
font-family: ansi2-custom-font, Courier, monospace;
font-size: {fn_h}px;
}}
{font_style}
{style}
Expand Down
2 changes: 1 addition & 1 deletion assets/vitest.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/win11.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cdca34b

Please sign in to comment.