Comments (8)
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.
The linked commit doesn't change body1
& body2
but instead updates subtitle1
& subtitle2
from mudblazor.
Good catch, I somehow got confused and actually meant to say subtitle1
from mudblazor.
The landing page uses subtitle1 heavily.
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.
@henon @danielchalmers @tpmccrary @lortimer
from mudblazor.
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.
the
span
should havedisplay: block
on it
Sounds like an easy fix
from mudblazor.
Related Issues (20)
- Lack of Range Operator for Date and Number Filtering in DataGrid HOT 3
- MudDataGrid Export tools HOT 4
- Missing CSS class .order-xs-* HOT 3
- MudTooltip: Add Disabled parameter HOT 1
- MudDateRangePicker doesn't run custom Validation function.
- DataGrid edit not working when object contains abstract class HOT 5
- Functionalities not working in some Razor Components HOT 3
- MudDataGrid HeaderStyleFunc is not Implemented HOT 1
- EditForm and MudTextField not displaying error messages correctly in .NET 8 HOT 8
- infinite loop HOT 8
- Add `Gutters` property to control padding on applicable inputs HOT 5
- MudForm: Optional margin between items HOT 2
- MudSlider no longer accepts nullable types HOT 10
- Components: Remove tap delay on mobile HOT 3
- Time Picker: Add Keyboard Mode HOT 2
- MudChart Line Y Axis - Allow fixed range of values
- Autocomplete: Adornments are styled as Icon Buttons HOT 6
- Components: Normalize dimensions and font sizes HOT 6
- Model state not updated in MudTable when using an IEnumerable and server-side data-retrieval
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mudblazor.