mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-12 06:06:37 +03:00
fix(live): subtle focus ring on global-bar icon buttons
Default browser focus-visible ring was a heavy blue outline that clashed with the dark capsule. Inject a palette-aware inner box-shadow ring (accentSoft + accent) scoped to the global bar buttons via a one-time <style> tag. Keeps keyboard focus visible without the visual noise.
This commit is contained in:
@@ -2575,6 +2575,21 @@ void main() {
|
||||
const theme = detectPageTheme();
|
||||
const P = barPaletteForTheme(theme);
|
||||
|
||||
// Custom focus-visible for bar buttons. Browser default is a heavy
|
||||
// blue ring that looks jarring on the dark capsule. Replace with a
|
||||
// soft accent-tinted inner ring that respects the bar's palette.
|
||||
if (!document.getElementById(PREFIX + '-bar-focus-style')) {
|
||||
const s = document.createElement('style');
|
||||
s.id = PREFIX + '-bar-focus-style';
|
||||
s.textContent =
|
||||
'#' + PREFIX + '-global-bar button:focus { outline: none; }' +
|
||||
'#' + PREFIX + '-global-bar button:focus-visible {' +
|
||||
' outline: none;' +
|
||||
' box-shadow: 0 0 0 2px ' + P.accentSoft + ', 0 0 0 3px ' + P.accent + ';' +
|
||||
'}';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
|
||||
globalBarEl = el('div', {
|
||||
position: 'fixed', bottom: '14px', left: '50%',
|
||||
transform: 'translateX(-50%) translateY(20px)',
|
||||
|
||||
@@ -2575,6 +2575,21 @@ void main() {
|
||||
const theme = detectPageTheme();
|
||||
const P = barPaletteForTheme(theme);
|
||||
|
||||
// Custom focus-visible for bar buttons. Browser default is a heavy
|
||||
// blue ring that looks jarring on the dark capsule. Replace with a
|
||||
// soft accent-tinted inner ring that respects the bar's palette.
|
||||
if (!document.getElementById(PREFIX + '-bar-focus-style')) {
|
||||
const s = document.createElement('style');
|
||||
s.id = PREFIX + '-bar-focus-style';
|
||||
s.textContent =
|
||||
'#' + PREFIX + '-global-bar button:focus { outline: none; }' +
|
||||
'#' + PREFIX + '-global-bar button:focus-visible {' +
|
||||
' outline: none;' +
|
||||
' box-shadow: 0 0 0 2px ' + P.accentSoft + ', 0 0 0 3px ' + P.accent + ';' +
|
||||
'}';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
|
||||
globalBarEl = el('div', {
|
||||
position: 'fixed', bottom: '14px', left: '50%',
|
||||
transform: 'translateX(-50%) translateY(20px)',
|
||||
|
||||
@@ -2575,6 +2575,21 @@ void main() {
|
||||
const theme = detectPageTheme();
|
||||
const P = barPaletteForTheme(theme);
|
||||
|
||||
// Custom focus-visible for bar buttons. Browser default is a heavy
|
||||
// blue ring that looks jarring on the dark capsule. Replace with a
|
||||
// soft accent-tinted inner ring that respects the bar's palette.
|
||||
if (!document.getElementById(PREFIX + '-bar-focus-style')) {
|
||||
const s = document.createElement('style');
|
||||
s.id = PREFIX + '-bar-focus-style';
|
||||
s.textContent =
|
||||
'#' + PREFIX + '-global-bar button:focus { outline: none; }' +
|
||||
'#' + PREFIX + '-global-bar button:focus-visible {' +
|
||||
' outline: none;' +
|
||||
' box-shadow: 0 0 0 2px ' + P.accentSoft + ', 0 0 0 3px ' + P.accent + ';' +
|
||||
'}';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
|
||||
globalBarEl = el('div', {
|
||||
position: 'fixed', bottom: '14px', left: '50%',
|
||||
transform: 'translateX(-50%) translateY(20px)',
|
||||
|
||||
@@ -2575,6 +2575,21 @@ void main() {
|
||||
const theme = detectPageTheme();
|
||||
const P = barPaletteForTheme(theme);
|
||||
|
||||
// Custom focus-visible for bar buttons. Browser default is a heavy
|
||||
// blue ring that looks jarring on the dark capsule. Replace with a
|
||||
// soft accent-tinted inner ring that respects the bar's palette.
|
||||
if (!document.getElementById(PREFIX + '-bar-focus-style')) {
|
||||
const s = document.createElement('style');
|
||||
s.id = PREFIX + '-bar-focus-style';
|
||||
s.textContent =
|
||||
'#' + PREFIX + '-global-bar button:focus { outline: none; }' +
|
||||
'#' + PREFIX + '-global-bar button:focus-visible {' +
|
||||
' outline: none;' +
|
||||
' box-shadow: 0 0 0 2px ' + P.accentSoft + ', 0 0 0 3px ' + P.accent + ';' +
|
||||
'}';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
|
||||
globalBarEl = el('div', {
|
||||
position: 'fixed', bottom: '14px', left: '50%',
|
||||
transform: 'translateX(-50%) translateY(20px)',
|
||||
|
||||
@@ -2575,6 +2575,21 @@ void main() {
|
||||
const theme = detectPageTheme();
|
||||
const P = barPaletteForTheme(theme);
|
||||
|
||||
// Custom focus-visible for bar buttons. Browser default is a heavy
|
||||
// blue ring that looks jarring on the dark capsule. Replace with a
|
||||
// soft accent-tinted inner ring that respects the bar's palette.
|
||||
if (!document.getElementById(PREFIX + '-bar-focus-style')) {
|
||||
const s = document.createElement('style');
|
||||
s.id = PREFIX + '-bar-focus-style';
|
||||
s.textContent =
|
||||
'#' + PREFIX + '-global-bar button:focus { outline: none; }' +
|
||||
'#' + PREFIX + '-global-bar button:focus-visible {' +
|
||||
' outline: none;' +
|
||||
' box-shadow: 0 0 0 2px ' + P.accentSoft + ', 0 0 0 3px ' + P.accent + ';' +
|
||||
'}';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
|
||||
globalBarEl = el('div', {
|
||||
position: 'fixed', bottom: '14px', left: '50%',
|
||||
transform: 'translateX(-50%) translateY(20px)',
|
||||
|
||||
@@ -2575,6 +2575,21 @@ void main() {
|
||||
const theme = detectPageTheme();
|
||||
const P = barPaletteForTheme(theme);
|
||||
|
||||
// Custom focus-visible for bar buttons. Browser default is a heavy
|
||||
// blue ring that looks jarring on the dark capsule. Replace with a
|
||||
// soft accent-tinted inner ring that respects the bar's palette.
|
||||
if (!document.getElementById(PREFIX + '-bar-focus-style')) {
|
||||
const s = document.createElement('style');
|
||||
s.id = PREFIX + '-bar-focus-style';
|
||||
s.textContent =
|
||||
'#' + PREFIX + '-global-bar button:focus { outline: none; }' +
|
||||
'#' + PREFIX + '-global-bar button:focus-visible {' +
|
||||
' outline: none;' +
|
||||
' box-shadow: 0 0 0 2px ' + P.accentSoft + ', 0 0 0 3px ' + P.accent + ';' +
|
||||
'}';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
|
||||
globalBarEl = el('div', {
|
||||
position: 'fixed', bottom: '14px', left: '50%',
|
||||
transform: 'translateX(-50%) translateY(20px)',
|
||||
|
||||
@@ -2575,6 +2575,21 @@ void main() {
|
||||
const theme = detectPageTheme();
|
||||
const P = barPaletteForTheme(theme);
|
||||
|
||||
// Custom focus-visible for bar buttons. Browser default is a heavy
|
||||
// blue ring that looks jarring on the dark capsule. Replace with a
|
||||
// soft accent-tinted inner ring that respects the bar's palette.
|
||||
if (!document.getElementById(PREFIX + '-bar-focus-style')) {
|
||||
const s = document.createElement('style');
|
||||
s.id = PREFIX + '-bar-focus-style';
|
||||
s.textContent =
|
||||
'#' + PREFIX + '-global-bar button:focus { outline: none; }' +
|
||||
'#' + PREFIX + '-global-bar button:focus-visible {' +
|
||||
' outline: none;' +
|
||||
' box-shadow: 0 0 0 2px ' + P.accentSoft + ', 0 0 0 3px ' + P.accent + ';' +
|
||||
'}';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
|
||||
globalBarEl = el('div', {
|
||||
position: 'fixed', bottom: '14px', left: '50%',
|
||||
transform: 'translateX(-50%) translateY(20px)',
|
||||
|
||||
@@ -2575,6 +2575,21 @@ void main() {
|
||||
const theme = detectPageTheme();
|
||||
const P = barPaletteForTheme(theme);
|
||||
|
||||
// Custom focus-visible for bar buttons. Browser default is a heavy
|
||||
// blue ring that looks jarring on the dark capsule. Replace with a
|
||||
// soft accent-tinted inner ring that respects the bar's palette.
|
||||
if (!document.getElementById(PREFIX + '-bar-focus-style')) {
|
||||
const s = document.createElement('style');
|
||||
s.id = PREFIX + '-bar-focus-style';
|
||||
s.textContent =
|
||||
'#' + PREFIX + '-global-bar button:focus { outline: none; }' +
|
||||
'#' + PREFIX + '-global-bar button:focus-visible {' +
|
||||
' outline: none;' +
|
||||
' box-shadow: 0 0 0 2px ' + P.accentSoft + ', 0 0 0 3px ' + P.accent + ';' +
|
||||
'}';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
|
||||
globalBarEl = el('div', {
|
||||
position: 'fixed', bottom: '14px', left: '50%',
|
||||
transform: 'translateX(-50%) translateY(20px)',
|
||||
|
||||
@@ -2575,6 +2575,21 @@ void main() {
|
||||
const theme = detectPageTheme();
|
||||
const P = barPaletteForTheme(theme);
|
||||
|
||||
// Custom focus-visible for bar buttons. Browser default is a heavy
|
||||
// blue ring that looks jarring on the dark capsule. Replace with a
|
||||
// soft accent-tinted inner ring that respects the bar's palette.
|
||||
if (!document.getElementById(PREFIX + '-bar-focus-style')) {
|
||||
const s = document.createElement('style');
|
||||
s.id = PREFIX + '-bar-focus-style';
|
||||
s.textContent =
|
||||
'#' + PREFIX + '-global-bar button:focus { outline: none; }' +
|
||||
'#' + PREFIX + '-global-bar button:focus-visible {' +
|
||||
' outline: none;' +
|
||||
' box-shadow: 0 0 0 2px ' + P.accentSoft + ', 0 0 0 3px ' + P.accent + ';' +
|
||||
'}';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
|
||||
globalBarEl = el('div', {
|
||||
position: 'fixed', bottom: '14px', left: '50%',
|
||||
transform: 'translateX(-50%) translateY(20px)',
|
||||
|
||||
@@ -2575,6 +2575,21 @@ void main() {
|
||||
const theme = detectPageTheme();
|
||||
const P = barPaletteForTheme(theme);
|
||||
|
||||
// Custom focus-visible for bar buttons. Browser default is a heavy
|
||||
// blue ring that looks jarring on the dark capsule. Replace with a
|
||||
// soft accent-tinted inner ring that respects the bar's palette.
|
||||
if (!document.getElementById(PREFIX + '-bar-focus-style')) {
|
||||
const s = document.createElement('style');
|
||||
s.id = PREFIX + '-bar-focus-style';
|
||||
s.textContent =
|
||||
'#' + PREFIX + '-global-bar button:focus { outline: none; }' +
|
||||
'#' + PREFIX + '-global-bar button:focus-visible {' +
|
||||
' outline: none;' +
|
||||
' box-shadow: 0 0 0 2px ' + P.accentSoft + ', 0 0 0 3px ' + P.accent + ';' +
|
||||
'}';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
|
||||
globalBarEl = el('div', {
|
||||
position: 'fixed', bottom: '14px', left: '50%',
|
||||
transform: 'translateX(-50%) translateY(20px)',
|
||||
|
||||
@@ -2575,6 +2575,21 @@ void main() {
|
||||
const theme = detectPageTheme();
|
||||
const P = barPaletteForTheme(theme);
|
||||
|
||||
// Custom focus-visible for bar buttons. Browser default is a heavy
|
||||
// blue ring that looks jarring on the dark capsule. Replace with a
|
||||
// soft accent-tinted inner ring that respects the bar's palette.
|
||||
if (!document.getElementById(PREFIX + '-bar-focus-style')) {
|
||||
const s = document.createElement('style');
|
||||
s.id = PREFIX + '-bar-focus-style';
|
||||
s.textContent =
|
||||
'#' + PREFIX + '-global-bar button:focus { outline: none; }' +
|
||||
'#' + PREFIX + '-global-bar button:focus-visible {' +
|
||||
' outline: none;' +
|
||||
' box-shadow: 0 0 0 2px ' + P.accentSoft + ', 0 0 0 3px ' + P.accent + ';' +
|
||||
'}';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
|
||||
globalBarEl = el('div', {
|
||||
position: 'fixed', bottom: '14px', left: '50%',
|
||||
transform: 'translateX(-50%) translateY(20px)',
|
||||
|
||||
@@ -2575,6 +2575,21 @@ void main() {
|
||||
const theme = detectPageTheme();
|
||||
const P = barPaletteForTheme(theme);
|
||||
|
||||
// Custom focus-visible for bar buttons. Browser default is a heavy
|
||||
// blue ring that looks jarring on the dark capsule. Replace with a
|
||||
// soft accent-tinted inner ring that respects the bar's palette.
|
||||
if (!document.getElementById(PREFIX + '-bar-focus-style')) {
|
||||
const s = document.createElement('style');
|
||||
s.id = PREFIX + '-bar-focus-style';
|
||||
s.textContent =
|
||||
'#' + PREFIX + '-global-bar button:focus { outline: none; }' +
|
||||
'#' + PREFIX + '-global-bar button:focus-visible {' +
|
||||
' outline: none;' +
|
||||
' box-shadow: 0 0 0 2px ' + P.accentSoft + ', 0 0 0 3px ' + P.accent + ';' +
|
||||
'}';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
|
||||
globalBarEl = el('div', {
|
||||
position: 'fixed', bottom: '14px', left: '50%',
|
||||
transform: 'translateX(-50%) translateY(20px)',
|
||||
|
||||
Reference in New Issue
Block a user