Use dark background for inline code in markdown widget
This commit is contained in:
parent
ddcf02f9d0
commit
4dc7b9b961
2 changed files with 10 additions and 13 deletions
|
|
@ -8,9 +8,8 @@ use crate::core::border;
|
|||
use crate::core::font::{self, Font};
|
||||
use crate::core::padding;
|
||||
use crate::core::text::Background;
|
||||
use crate::core::theme::palette;
|
||||
use crate::core::theme::Theme;
|
||||
use crate::core::{self, Element, Length, Pixels};
|
||||
use crate::core::theme::{self, Theme};
|
||||
use crate::core::{self, color, Color, Element, Length, Pixels};
|
||||
use crate::{column, container, rich_text, row, scrollable, span, text};
|
||||
|
||||
pub use pulldown_cmark::HeadingLevel;
|
||||
|
|
@ -39,7 +38,7 @@ pub enum Item {
|
|||
/// Parse the given Markdown content.
|
||||
pub fn parse<'a>(
|
||||
markdown: &'a str,
|
||||
palette: &'a palette::Extended,
|
||||
palette: &'a theme::Palette,
|
||||
) -> impl Iterator<Item = Item> + 'a {
|
||||
struct List {
|
||||
start: Option<u64>,
|
||||
|
|
@ -250,7 +249,7 @@ pub fn parse<'a>(
|
|||
};
|
||||
|
||||
let span = if let Some(link) = link.as_ref() {
|
||||
span.color(palette.primary.base.color).link(link.clone())
|
||||
span.color(palette.primary).link(link.clone())
|
||||
} else {
|
||||
span
|
||||
};
|
||||
|
|
@ -262,13 +261,14 @@ pub fn parse<'a>(
|
|||
pulldown_cmark::Event::Code(code) if !metadata && !table => {
|
||||
let span = span(code.into_string())
|
||||
.font(Font::MONOSPACE)
|
||||
.color(Color::WHITE)
|
||||
.background(Background {
|
||||
color: palette.background.weak.color,
|
||||
color: color!(0x111111),
|
||||
border: border::rounded(2),
|
||||
});
|
||||
|
||||
let span = if let Some(link) = link.as_ref() {
|
||||
span.color(palette.primary.base.color).link(link.clone())
|
||||
span.color(palette.primary).link(link.clone())
|
||||
} else {
|
||||
span
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue