material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[Typography] headlineMapping semantics

Open Zuurkern opened this issue 9 years ago • 3 comments

Problem description

const headlineMapping: { [key: Type]: string } = {
  display4: 'h1',
  display3: 'h1',
  display2: 'h1',
  display1: 'h1',
  headline: 'h1',
  title: 'h2',
  subheading: 'h3',
  body2: 'aside',
  body1: 'p',
};

I think title should use h1 as it is used for the page title in the App Bar. I also don't understand why body2 uses aside. How can you know the semantic context in advance? I have used body2 many times in our apps and it's never used as an aside.

Which makes me wonder, why have these opinionated defaults in the first place? I'm genuinely curious as to what the reasoning behind this was. As far as I know, the Guidelines don't mention anything about coupling the styles to semantic elements.

Versions

  • Material-UI: next v1.0.0-alpha.13

Zuurkern avatar May 11 '17 09:05 Zuurkern

I have been using this demo for the choice of the default elements. I'm not sure it's the best choices, still, that's a good default to begin with. I'm happy to discuss potential changes.

oliviertassinari avatar May 11 '17 11:05 oliviertassinari

Ok, I see now. Makes me wonder why they chose these. I'll do some digging.

Zuurkern avatar May 11 '17 15:05 Zuurkern

I'm closing that issue for now. If you want to change any of the default element, feel free to submit a PR and to defend your case. Thanks for raising that concern 👍 .

oliviertassinari avatar May 20 '17 08:05 oliviertassinari