Implement professional smart formatting with toggle logic and whitespace preservation
This commit is contained in:
@@ -442,6 +442,76 @@ body:not(.insertr-edit-mode) .insertr-editing-hover::after {
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* Active/applied formatting state - shows current selection has this formatting */
|
||||
.insertr-style-btn.insertr-style-active {
|
||||
background: var(--insertr-primary);
|
||||
border-color: var(--insertr-primary);
|
||||
color: white;
|
||||
box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
|
||||
}
|
||||
|
||||
.insertr-style-btn.insertr-style-active .insertr-preview-content {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.insertr-style-btn.insertr-style-active:hover {
|
||||
background: var(--insertr-primary-hover);
|
||||
border-color: var(--insertr-primary-hover);
|
||||
transform: none;
|
||||
}
|
||||
|
||||
/* Active state for default style buttons */
|
||||
.insertr-style-btn.insertr-default-style.insertr-style-active {
|
||||
background: var(--insertr-info);
|
||||
border-color: var(--insertr-info);
|
||||
color: white;
|
||||
box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
|
||||
}
|
||||
|
||||
.insertr-style-btn.insertr-default-style.insertr-style-active .insertr-preview-content {
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* Default formatting style buttons */
|
||||
.insertr-style-btn.insertr-default-style {
|
||||
border-color: var(--insertr-info);
|
||||
background: rgba(23, 162, 184, 0.1);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.insertr-style-btn.insertr-default-style:hover {
|
||||
border-color: var(--insertr-info);
|
||||
background: rgba(23, 162, 184, 0.2);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
|
||||
}
|
||||
|
||||
.insertr-style-btn.insertr-default-style:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 1px 2px rgba(23, 162, 184, 0.2);
|
||||
}
|
||||
|
||||
/* Default preview content styling */
|
||||
.insertr-default-preview {
|
||||
font-size: var(--insertr-font-size-sm);
|
||||
font-weight: 500;
|
||||
padding: var(--insertr-spacing-xs) var(--insertr-spacing-sm);
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Small indicator for default styles */
|
||||
.insertr-style-btn.insertr-default-style::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
right: 2px;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
background: var(--insertr-info);
|
||||
border-radius: 50%;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/* Editor components */
|
||||
.insertr-simple-editor,
|
||||
.insertr-rich-editor,
|
||||
@@ -479,7 +549,126 @@ body:not(.insertr-edit-mode) .insertr-editing-hover::after {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
/* =================================================================
|
||||
MULTI-PROPERTY FORM COMPONENTS
|
||||
Professional form styling for direct editors (links, buttons, images)
|
||||
================================================================= */
|
||||
|
||||
/* Direct editor container */
|
||||
.insertr-direct-editor {
|
||||
background: var(--insertr-bg-primary);
|
||||
border: 1px solid var(--insertr-border-color);
|
||||
border-radius: var(--insertr-border-radius);
|
||||
padding: var(--insertr-spacing-lg);
|
||||
min-width: 400px;
|
||||
max-width: 600px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
font-family: var(--insertr-font-family);
|
||||
color: var(--insertr-text-primary);
|
||||
}
|
||||
|
||||
/* Form groups */
|
||||
.insertr-form-group {
|
||||
margin-bottom: var(--insertr-spacing-md);
|
||||
}
|
||||
|
||||
.insertr-form-group:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* Form labels */
|
||||
.insertr-form-label {
|
||||
display: block;
|
||||
margin-bottom: var(--insertr-spacing-xs);
|
||||
font-weight: 500;
|
||||
font-size: var(--insertr-font-size-sm);
|
||||
color: var(--insertr-text-primary);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/* Form inputs and selects */
|
||||
.insertr-form-input,
|
||||
.insertr-form-select {
|
||||
width: 100%;
|
||||
padding: var(--insertr-spacing-sm) var(--insertr-spacing-md);
|
||||
border: 1px solid var(--insertr-border-color);
|
||||
border-radius: var(--insertr-border-radius);
|
||||
font-size: var(--insertr-font-size-base);
|
||||
font-family: var(--insertr-font-family);
|
||||
line-height: 1.4;
|
||||
color: var(--insertr-text-primary);
|
||||
background: var(--insertr-bg-primary);
|
||||
transition: var(--insertr-transition);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* Focus states */
|
||||
.insertr-form-input:focus,
|
||||
.insertr-form-select:focus {
|
||||
outline: none;
|
||||
border-color: var(--insertr-primary);
|
||||
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
|
||||
}
|
||||
|
||||
/* Hover states for selects */
|
||||
.insertr-form-select:hover {
|
||||
border-color: var(--insertr-text-secondary);
|
||||
}
|
||||
|
||||
/* Disabled states */
|
||||
.insertr-form-input:disabled,
|
||||
.insertr-form-select:disabled {
|
||||
background: var(--insertr-bg-secondary);
|
||||
color: var(--insertr-text-muted);
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
/* Error states */
|
||||
.insertr-form-input.insertr-error,
|
||||
.insertr-form-select.insertr-error {
|
||||
border-color: var(--insertr-danger);
|
||||
box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
|
||||
}
|
||||
|
||||
/* Success states */
|
||||
.insertr-form-input.insertr-success,
|
||||
.insertr-form-select.insertr-success {
|
||||
border-color: var(--insertr-success);
|
||||
box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
|
||||
}
|
||||
|
||||
/* Form validation messages */
|
||||
.insertr-form-message {
|
||||
margin-top: var(--insertr-spacing-xs);
|
||||
font-size: var(--insertr-font-size-sm);
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.insertr-form-message.insertr-error {
|
||||
color: var(--insertr-danger);
|
||||
}
|
||||
|
||||
.insertr-form-message.insertr-success {
|
||||
color: var(--insertr-success);
|
||||
}
|
||||
|
||||
.insertr-form-message.insertr-info {
|
||||
color: var(--insertr-info);
|
||||
}
|
||||
|
||||
/* Specific editor variants */
|
||||
.insertr-link-editor {
|
||||
/* Link-specific styling if needed */
|
||||
}
|
||||
|
||||
.insertr-button-editor {
|
||||
/* Button-specific styling if needed */
|
||||
}
|
||||
|
||||
.insertr-image-editor {
|
||||
/* Image-specific styling if needed */
|
||||
}
|
||||
|
||||
/* Form actions */
|
||||
.insertr-form-actions {
|
||||
|
||||
Reference in New Issue
Block a user