Giter Site home page Giter Site logo

code-refactor's People

Contributors

dmidlo avatar

Stargazers

 avatar

Watchers

 avatar  avatar

code-refactor's Issues

index.html has no aria role for hero image

line 27:

going to use role=img.

because it's an image.


The image is rendered using css, to accomplish typical hero image behavior of allowing the image to fill its container.

since this is an image, the argument can be made that it is the hero image and therefore not unimportant and therefore should also have alt text. However, a div (as leveraged by css to place to image) will not receive alt text.

these two points could be solved in two ways;

One, refactor the hero object and its related css to use an img element instead of a div, or;
Two, use aria-label
https://www.davidmacd.com/blog/alternate-text-for-css-background-images.html


the davidmacd.com article also mentions that a span is best used in this case instead of a div because any of the div's contents might be obscured from screen readers. Switching div to span, but I'm expecting it to be a breaking change.


as expected, change to span produced failing regression test. setting display: block on hero span.

Duplicate css code

the two regions for services and benefits reuse lots of the same code.

After a million rebases to edit the commit messages...

I had no idea editing commit messages would be so involved...

After a million rebases to edit the commit messages in order to figure out the best way to get github issue tagging to display a way I like it within the github webapp's commit log; I've finally settled on beginning each commit message with:

Issue #NUM - a descriptive and concise commit message

~ or ~

PR #NUM - a descriptive and concise commit message

This issue will remain open forevermore to remind me that rebasing a million times makes issue history r within this selfsame web app insanely cluttered. I guess rebase gives new hashes????

I deeply apologize to anyone who clicks on any of these issues. Thankfully, any of the commit hashes will lead to the same code and the timestamps within the commit log show the oldest and therefore the original time of commit.

the content and benefits elements use a generic div

they are sections. I considered using an aside for the benefits section because of its vertical column, but such presentation issues are the domain of CSS and have nothing to do with the meaning of the document in this case. A designer may change the layout, and the semantics will still be valid here.


another error came up after this change that points to the proper solution. The w3c validator extension for vscode reports the warning:
"Section lacks heading. Consider using “h2”-“h6” elements to add identifying headings to all sections."

This, along with previous research; points to the idea that in order to be a section instead of a div, an element probably should have user-visible content as immediate children and not simply other component elements.

To be most compliant, without triggering any a11y warnings, the solution to the use of divs here is to use the wia-aria role="region" attribute on the divs. Since region is an aria landmark, and two of them are in use, an aria-label="Example" should be applied as well.


Does it turn out that this page makes no use of a section element? yep, in every place I started with a section, but once applying the w3c rule that sections should have a h1-h6 element as a direct child to be semantically sound and that articles, and NOT sections, define a bound around redistributability, it became clear that divs still have their place as a generic element.

The only place that almost became a section was the main element. Thereto main was more specific, well... and it's quite clear that main should occupy the empty space between a header and footer element. In your code editor (think code readability), you can then collapse this layout's code to focus on just the header, footer, or main code.

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.