Curious learner: What's the reason for the multiple input focus styles?
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 93
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Asking this because I'm curious and slightly out of my depth with my css-fu. And because hopefully it may help future others and serve as documentation for the thinking behind some of the detail of Roux's boilerplate!
In _forms.css Roux styles the focus state of form inputs in 2 places (code snippets abbreviated below):
:is(input) {
&:focus {
outline: var(--border-width--base) solid var(--color--primary-base);
}
}
:where(input:not([type])) {
&:focus-visible {
outline: var(--border-width--thick) solid var(--color--focus);
outline-offset: 2px;
}
}
Some questions from ignorance:
- What is the intention with setting this in both the
:isand:whereblocks? - Why
&:focusvs&:focus-visible? - I see the
:whereblock with:&:focus-visiblehas--border-width--thickbut I can't seem to see this in the app when I focus on an input - If I want to update the default behaviour for input focus which should I use?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with _forms.css and compare the two input focus blocks named in the issue. Verify their behavior in the app, then document the intent of each selector, the difference between :focus and :focus-visible, and which block controls default input focus styling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100