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

Why not use semantic elements in examples? #30

Closed
mrmrs opened this issue Apr 21, 2016 · 2 comments
Closed

Why not use semantic elements in examples? #30

mrmrs opened this issue Apr 21, 2016 · 2 comments
Labels

Comments

@mrmrs
Copy link

mrmrs commented Apr 21, 2016

Here you use these code example as "good" but they don't inform a computer or screenreader how to classify the content. Screenreader's do not parse class names for meaning. Can you elaborate how this markup in the example is more semantic?

<!-- good -->
<div class="header"></div>
<div class="basket"></div>
<div class="product"></div>
<div class="searchResults"></div>
@adamsilver
Copy link
Owner

adamsilver commented Apr 22, 2016

@mrmrs

Why not use semantic elements in examples?

You're correct. I did not use semantic elements for say the header but for two reasons:

  1. MaintainableCSS is emphasising the use of additional class names, as is stated in the book.
  2. Using HTML5 can be problematic because some browsers don't style unrecognised HTML.

Some may be cool with it, some may not and avoid, some will use it and frig it with JS etc but I purposely avoided that in the guides. Perhaps I should provide a note on this. Thank you for bringing it to my attention.

Re screenreaders etc

You are correct, computers or screen readers will not benefit from these class names.

Can you elaborate how this markup in the example is more semantic?

No more than I already have done in your previous github issues and the book itself.

HTH

Repository owner locked and limited conversation to collaborators Apr 25, 2016
Repository owner unlocked this conversation Mar 3, 2017
@adamsilver
Copy link
Owner

I have by the way since added HTML5 elements to the site. Happy to let non-supporting browsers lose support for styling.

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

No branches or pull requests

2 participants