Coder Social home page Coder Social logo

smaller css about tabby HOT 3 CLOSED

cferdinandi avatar cferdinandi commented on May 18, 2024
smaller css

from tabby.

Comments (3)

cferdinandi avatar cferdinandi commented on May 18, 2024 1

You've made your content inaccessible to a lot of people with these changes.

Tabby forgoes aria roles in favor of simple, progressively enhanced anchor links. There are a few aspects to this approach.

First, don't use display: none. It hides content completely from screen readers.

Tabby deliberately uses a more verbose set of CSS that only visually hides the content. Someone viewing the site via a screen reader simply sees anchor links and navigates through the full set of content.

Another important part of how Tabby works is keyboard navigation. If I tab into a closed content area that contains a link, that content area should become active (check out the demo to see what I mean).

Again, display: none prevents this from happening, as the content area is removed from the tab flow.

The tabby CSS, minified, is 322 bytes. That's less than 1/3rd of a KB. Gzipped, it's probably closer to 100 bytes.

To save just a few bytes, you're making your site far less accessible.

from tabby.

Aranjedeath avatar Aranjedeath commented on May 18, 2024

OK. I didn't know display:none; had any effect on screen readers (I didn't know they didn't just read the code directly, which would facilitate ignoring things like display:none;). I now want to punch a standards committee member. Thanks for your response.

from tabby.

cferdinandi avatar cferdinandi commented on May 18, 2024

That's actually by design, and makes quite a bit of sense. If you're saying that a piece of content should not be displayed, why would you want a screen reader to read it? You're effectively "removing it" from the DOM.

Hence the visually hidden technique.

from tabby.

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.