Unify all formatting buttons to use consistent three-layer architecture

- Remove .insertr-default-style special styling (blue background, border, dot indicator)
- Make ALL buttons use .insertr-style-preview with unified appearance
- Maintain authentic style previews in isolated .insertr-style-sample layer
- Bold buttons show bold text, .brand buttons show green uppercase text, etc.
- Eliminate visual inconsistency between semantic and detected style buttons
- Simplify CSS by removing ~50 lines of duplicate button styling
- Provide consistent professional toolbar appearance across all formatting options
This commit is contained in:
2025-09-21 22:31:42 +02:00
parent 479a537f21
commit b25663f76b
5 changed files with 8 additions and 299 deletions

View File

@@ -639,12 +639,12 @@ export class StyleAwareEditor {
applyStyleButtonStyling(button, styleSample, styleInfo) {
if (!styleInfo) return;
// Apply styling based on whether this is a detected style or default
// ALL buttons use the same unified three-layer architecture
button.classList.add('insertr-style-preview');
// Apply appropriate preview styling to the isolated sample
if (styleInfo.isDefault) {
// Default style - apply semantic styling
button.classList.add('insertr-default-style');
// Add semantic styling for default elements
// Default semantic formatting - apply styling to sample
if (styleInfo.tagName === 'strong') {
styleSample.style.fontWeight = 'bold';
} else if (styleInfo.tagName === 'em') {
@@ -657,10 +657,7 @@ export class StyleAwareEditor {
// Add helpful description to title
button.title = `${styleInfo.name}: ${styleInfo.description || 'Default formatting option'}`;
} else if (styleInfo.element && styleInfo.classes && styleInfo.classes.length > 0) {
// Detected style - apply original classes to style sample
button.classList.add('insertr-style-preview');
// Add the detected classes to the style sample (isolated preview)
// Detected style - apply original classes to style sample (isolated preview)
styleInfo.classes.forEach(className => {
styleSample.classList.add(className);
});
@@ -668,7 +665,6 @@ export class StyleAwareEditor {
button.title = `Apply ${styleInfo.classes.join(' ')} styling`;
} else {
// No meaningful styles detected - use fallback
button.classList.add('insertr-style-preview');
styleSample.classList.add('insertr-fallback-style');
}
}