Giter Club home page Giter Club logo

Comments (8)

lortimer avatar lortimer commented on May 28, 2024 3

I'm not sure why I was tagged. As I said on #6061, it's critical that MudBlazor doesn't use semantic elements incorrectly. As a component library, developers are counting on it to build their apps quickly without introducing accessibility issues. Accessibility issues create legal liability, styling doesn't.

MudBlazor should not go back to using h6 just to make centering work again. That would cause an accessibility issue for the sake of styling. If it needs to be a block element, then the span should have display: block on it. Better yet, MudBlazor should allow developers to easily style it however they need.

from mudblazor.

Anu6is avatar Anu6is commented on May 28, 2024 1

The linked commit doesn't change body1 & body2 but instead updates subtitle1 & subtitle2

from mudblazor.

meenzen avatar meenzen commented on May 28, 2024 1

Good catch, I somehow got confused and actually meant to say subtitle1

from mudblazor.

danielchalmers avatar danielchalmers commented on May 28, 2024 1

The landing page uses subtitle1 heavily.

image

This makes me think most people use it just to have smaller text so it should be <p>. Not that they should necessarily be using it that way but it's the reality of it. Of course an option to decide this (span vs p etc) within MudText is still possible.

We could repurpose the Inline property (or add a new one) to let the user choose themselves what type of element it should be and take care of #5535 at the same time. It should be p by default for backwards compatibility. We also need to think about how the Align property will work with this because it is mutually exclusive with Inline.

MudText.razor.cs

-/// <summary>
-/// If true, Sets display inline
-/// </summary>
-[Parameter]
-[Category(CategoryTypes.Text.Appearance)]
-public bool Inline { get; set; }

+/// <summary>
+/// The HTML element that will be rendered (<c>span</c>, <c>p</c>, <c>h1</c>).
+/// <br/>
+/// If <c>null</c> it is automatically decided based on <see cref="Typo"/>.
+/// </summary>
+/// <remarks>
+/// This can be used to specify the type of content for accessibility and SEO more accurately.
+/// <br/>
+/// https://developer.mozilla.org/en-US/docs/Web/HTML/Element#text_content
+/// </remarks>
+[Parameter]
+[Category(CategoryTypes.Text.Behavior)]
+public string? HtmlTag { get; set; }

from mudblazor.

ScarletKuro avatar ScarletKuro commented on May 28, 2024

@henon @danielchalmers @tpmccrary @lortimer

from mudblazor.

danielchalmers avatar danielchalmers commented on May 28, 2024

The problem is that, as a <span>, it no longer takes up a line so it can't text-align itself. display: block could work.
Or make it a <p>, though it would get picked up as paragraph by screen readers.

Could get creative and add a <MudSpan> as a building block

from mudblazor.

henon avatar henon commented on May 28, 2024

the span should have display: block on it

Sounds like an easy fix

from mudblazor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.