Files
cv-site/tests/mjs/debug-css-cascade.mjs
T
juanatsap e5c824970c fix: Override .has-tooltip position for theme switcher button
The theme switcher button was hidden above the viewport on desktop because
.has-tooltip's position: relative was overriding the button's position: fixed
due to CSS cascade order (_tooltips.css loaded after _themes.css).

Fixed by adding !important to .color-theme-switcher position: fixed rule.

Changes:
- static/css/01-foundation/_themes.css: Add !important to position: fixed
  to override .has-tooltip position: relative cascade

Testing:
- Added comprehensive tooltip tests for all buttons (desktop & mobile)
- Verified theme switcher visible on desktop at correct position
- Verified all tooltips working on hover (desktop only, hidden on mobile touch)
- Verified button positioning in mobile bottom dock

All buttons now display correctly:
 Desktop: All 6 buttons with working tooltips
 Mobile: All 5 buttons in bottom dock
2025-11-20 18:51:38 +00:00

49 lines
1.4 KiB
JavaScript
Executable File

#!/usr/bin/env bun
import { chromium } from 'playwright';
(async () => {
const browser = await chromium.launch({ headless: false });
const page = await browser.newPage();
await page.goto('http://localhost:1999/');
await page.waitForLoadState('networkidle');
await page.waitForTimeout(1000);
// Get all CSS rules affecting the theme button
const cssRules = await page.evaluate(() => {
const btn = document.getElementById('color-theme-switcher');
if (!btn) return null;
const matchedRules = [];
// Get all stylesheets
for (const sheet of document.styleSheets) {
try {
const rules = sheet.cssRules || sheet.rules;
for (const rule of rules) {
if (rule.selectorText && btn.matches(rule.selectorText)) {
matchedRules.push({
selector: rule.selectorText,
position: rule.style.position || 'not set',
bottom: rule.style.bottom || 'not set',
left: rule.style.left || 'not set',
source: sheet.href || 'inline',
cssText: rule.cssText
});
}
}
} catch (e) {
// Skip CORS blocked stylesheets
}
}
return matchedRules;
});
console.log('📋 CSS Rules matching #color-theme-switcher:');
console.log(JSON.stringify(cssRules, null, 2));
await page.waitForTimeout(5000);
await browser.close();
})();