Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am here again #89

Closed
dayAndnight2018 opened this issue Jan 4, 2023 · 5 comments
Closed

I am here again #89

dayAndnight2018 opened this issue Jan 4, 2023 · 5 comments

Comments

@dayAndnight2018
Copy link

I am here again just want to ask one question: could we upgrade the ui style ?
first, I want the there has indent before subItems following head tags. just like this:
image

that must more beautiful if relative css style is supported.

then, a little bit not polite, do we consider Material Design?

@dayAndnight2018
Copy link
Author

Besides, could we set the image's width and height ?

@dayAndnight2018
Copy link
Author

@whistyun

@whistyun
Copy link
Owner

first, I want the there has indent before subItems following head tags. just like this:

Because of setence element is used in various elements, we should overwrite style various element.

If you use Fluent style, the bellow sample helps indent sentence element.

<!-- xmlns:md="clr-namespace:Markdown.Avalonia;assembly=Markdown.Avalonia" -->
<!-- xmlns:ctxt="clr-namespace:ColorTextBlock.Avalonia;assembly=ColorTextBlock.Avalonia" -->

<md:MarkdownScrollViewer>
  <md:MarkdownScrollViewer.Styles>
    <Style Selector="ctxt|CTextBlock">
      <Style.Setters>
        <Setter Property="Margin" Value="20,5,0,5" />
      </Style.Setters>
    </Style>
  
    <!-- revert margin for heading -->
    <Style Selector="ctxt|CTextBlock.Heading1, ctxt|CTextBlock.Heading2, ctxt|CTextBlock.Heading3, ctxt|CTextBlock.Heading4">
      <Style.Setters>
        <Setter Property="Margin" Value="0,5" />
      </Style.Setters>
    </Style>
  
    <!-- revert margin for table -->
    <Style Selector="Grid.Table > Border > ctxt|CTextBlock">
      <Style.Setters>
        <Setter Property="Margin" Value="0,5" />
      </Style.Setters>
    </Style>
  
    <!-- revert margin for list -->
    <Style Selector=".List ctxt|CTextBlock">
      <Style.Setters>
        <Setter Property="Margin" Value="0,5" />
      </Style.Setters>
    </Style>
  
    <!-- re-revert margin for list marker -->
    <Style Selector="ctxt|CTextBlock.ListMarker">
      <Style.Setters>
        <Setter Property="Margin" Value="0,5,5,5"/>
      </Style.Setters>
    </Style>
  </md:MarkdownScrollViewer.Styles>
</md:MarkdownScrollViewer>

image

@whistyun
Copy link
Owner

that must more beautiful if relative css style is supported.

I think so too. However, I think that the conversion from css to Avalonia style shoud be done via another library instead of Markdown library.

There are no plans to build a css parser now.
If it does, it will be another library.

@whistyun
Copy link
Owner

whistyun commented Jan 10, 2023

Do we consider Material Design?

I are not considering adding proprietary styles that apply only within Markdown controls.

To avoid style inconsistencies, Markdown.Avalonia refers to the style theme used in the application (e.g. Avalonia.Themes.Fluent or Avalonia.Themes.Simple) to determine the style (e.g. SimpleTheme or FluentTheme).

I are considering adding styles for third parties that have their own styles (Aura.UI, FluentAvalonia, Material.Avalonia, etc.), but this approach risks library bloat and I'm wondering if I should really adopt it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants