These snippets are my attempt to save and organize various bits of code, best practices, and resources relating to web development and design. They also function as a to do list of sorts, for things I want to implement in my own code, but haven't yet. The concept is inspired by Jeremy Keith's links and CSS-Tricks, among other things. Enjoy.
Today is Global Accessibility Awareness Day - a great day to be talking about accessibility.
Accessibility is for everyone, it’s not an edge case.
Accessibility is cumulative not binary, the more you do for accessibility the more accessible your site is.
Use semantic HTML, browsers have a lot of accessibility built in.
Make things keyboard operable by using the keyboard from time to time when you’re developing.
Finally, you don’t have to ask permission to make things accessible.
The easiest way is to ensure that the config has a dependency on your module.dependencies: enforced: module: - yourmodule
Then Drupal will automatically remove that configuration and also warn in the UI that it will be removed.
The difference between a module’s install (i.e. required) config and optional config directories doesn’t seem well documented in Drupal 8, so this answer was quite informative:
install: The folder can contain configs, like a view or any other config. All configs will be installed, if any config fails module can’t be installed.
optional: The folder can contain configs, like a view or any other config. All configs will be installed if possible. If config has missing dependencies, it won’t be installed.
You’d be forgiven for thinking the point of this whole exercise is to shame the developers (you can always pick a name other than
shame.css) but it’s really not. I am well aware of (and responsible for) hacks and quick fixes; your product owner doesn’t care if you used an
!important, they just want the new feature out of the door. Hacks happen, fact.
shame.cssis jokingly titled to make it a little light-hearted whilst also indicating that anything in there is a bit of a shame; a shame to have to have done, a shame to pollute the codebase with and so on…
By isolating all your hacks and bodge-jobs in their own file you can really easily keep tabs on them; isolating them isn’t to shame the developers, not at all, it’s merely to make the team aware of them and make them painfully, unmissably obvious.
Obviously you need some kind of rules and criteria:
- If it’s a hack, it goes in
- Document all hacks fully:
- What part of the codebase does it relate to?
- Why was this needed?
- How does this fix it?
- How might you fix it properly, given more time?
- Do not blame the developer; if they explained why they had to do it then their reasons are probably (hopefully) valid.
- Try and clean
shame.cssup when you have some down time.
- Even better, get a tech-debt story in which you can dedicate actual sprint time to it.
This certainly seems like a good approach. That said, I personally prefer to have everything related to a component living with the component, but documented as a hack, possibly searchable via some sort of comment tag, like
An opinionated styleguide for writing sane, maintainable and scalable Sass.
[T]he basic questions an empty state should answer are:
- What is this screen?
- Why am I seeing it?
- How can I fix this problem?
On top of this, you should aim to:
- Communicate personality. Make your app a joy to use and connect feelings with features.
- Explain the benefits. This is critical for your first-use empty states so your users know why they should care.