Implement markdown collection support alongside existing element-level editing. Users can now choose between individual element editing (headlines, buttons) and rich markdown editing (stories, bios). Includes responsive overlay forms, smart field detection, and comprehensive documentation updates. Features: - Markdown collections with data-field-type="markdown" - Responsive overlay forms that adapt to element width - Element-level editing for granular control - Updated documentation and integration guide - Fixed marked.js renderer configuration issues - Enhanced about.html to demonstrate both approaches
236 lines
4.8 KiB
CSS
236 lines
4.8 KiB
CSS
/* Insertr Core Styles */
|
|
|
|
/* Hide edit indicators by default (customer view) */
|
|
.insertr-edit-btn {
|
|
display: none;
|
|
}
|
|
|
|
/* Show edit controls when authenticated and edit mode is on */
|
|
.insertr-authenticated.insertr-edit-mode .insertr {
|
|
position: relative;
|
|
border: 2px dashed transparent;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.insertr-authenticated.insertr-edit-mode .insertr:hover {
|
|
border-color: #3b82f6;
|
|
background-color: rgba(59, 130, 246, 0.05);
|
|
}
|
|
|
|
/* Edit button styling */
|
|
.insertr-authenticated.insertr-edit-mode .insertr-edit-btn {
|
|
display: block;
|
|
position: absolute;
|
|
top: 8px;
|
|
right: 8px;
|
|
width: 32px;
|
|
height: 32px;
|
|
background: #3b82f6;
|
|
color: white;
|
|
border: none;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: 16px;
|
|
z-index: 10;
|
|
transition: all 0.2s;
|
|
box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
|
|
}
|
|
|
|
.insertr-edit-btn:hover {
|
|
background: #2563eb;
|
|
transform: scale(1.05);
|
|
}
|
|
|
|
/* Edit overlay container */
|
|
.insertr-edit-overlay {
|
|
position: absolute;
|
|
z-index: 1000;
|
|
}
|
|
|
|
/* Edit form container */
|
|
.insertr-edit-form {
|
|
background: white;
|
|
border: 2px solid #3b82f6;
|
|
border-radius: 8px;
|
|
padding: 1rem;
|
|
box-shadow: 0 8px 25px rgba(0,0,0,0.15);
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
/* Form header */
|
|
.insertr-form-header {
|
|
font-weight: 600;
|
|
color: #1f2937;
|
|
margin-bottom: 1rem;
|
|
padding-bottom: 0.5rem;
|
|
border-bottom: 1px solid #e5e7eb;
|
|
font-size: 0.875rem;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
/* Form controls */
|
|
.insertr-form-group {
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.insertr-form-group:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.insertr-form-label {
|
|
display: block;
|
|
font-weight: 600;
|
|
color: #374151;
|
|
margin-bottom: 0.5rem;
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.insertr-form-input,
|
|
.insertr-form-textarea {
|
|
width: 100%;
|
|
padding: 0.75rem;
|
|
border: 1px solid #d1d5db;
|
|
border-radius: 6px;
|
|
font-family: inherit;
|
|
font-size: 1rem;
|
|
transition: border-color 0.2s, box-shadow 0.2s;
|
|
}
|
|
|
|
.insertr-form-input:focus,
|
|
.insertr-form-textarea:focus {
|
|
outline: none;
|
|
border-color: #3b82f6;
|
|
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
|
}
|
|
|
|
.insertr-form-textarea {
|
|
min-height: 120px;
|
|
resize: vertical;
|
|
font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
|
|
}
|
|
|
|
.insertr-markdown-editor {
|
|
min-height: 200px;
|
|
font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
|
|
font-size: 0.9rem;
|
|
line-height: 1.5;
|
|
background-color: #f8fafc;
|
|
}
|
|
|
|
/* Form actions */
|
|
.insertr-form-actions {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
justify-content: flex-end;
|
|
margin-top: 1rem;
|
|
padding-top: 1rem;
|
|
border-top: 1px solid #e5e7eb;
|
|
}
|
|
|
|
.insertr-btn-save {
|
|
background: #10b981;
|
|
color: white;
|
|
border: none;
|
|
padding: 0.5rem 1rem;
|
|
border-radius: 6px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: background-color 0.2s;
|
|
}
|
|
|
|
.insertr-btn-save:hover {
|
|
background: #059669;
|
|
}
|
|
|
|
.insertr-btn-cancel {
|
|
background: #6b7280;
|
|
color: white;
|
|
border: none;
|
|
padding: 0.5rem 1rem;
|
|
border-radius: 6px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: background-color 0.2s;
|
|
}
|
|
|
|
.insertr-btn-cancel:hover {
|
|
background: #4b5563;
|
|
}
|
|
|
|
/* Content type indicators */
|
|
.insertr[data-content-type="rich"]::before {
|
|
content: "📝";
|
|
position: absolute;
|
|
top: -8px;
|
|
left: -8px;
|
|
background: #8b5cf6;
|
|
color: white;
|
|
width: 24px;
|
|
height: 24px;
|
|
border-radius: 50%;
|
|
display: none;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 12px;
|
|
z-index: 5;
|
|
}
|
|
|
|
.insertr-authenticated.insertr-edit-mode .insertr[data-content-type="rich"]:hover::before {
|
|
display: flex;
|
|
}
|
|
|
|
/* Loading and success states */
|
|
.insertr-saving {
|
|
opacity: 0.7;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.insertr-save-success {
|
|
border-color: #10b981 !important;
|
|
background-color: rgba(16, 185, 129, 0.05) !important;
|
|
}
|
|
|
|
.insertr-save-success::after {
|
|
content: "✓ Saved";
|
|
position: absolute;
|
|
top: -8px;
|
|
right: -8px;
|
|
background: #10b981;
|
|
color: white;
|
|
padding: 2px 8px;
|
|
border-radius: 4px;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
z-index: 15;
|
|
animation: fadeInOut 2s ease-in-out;
|
|
}
|
|
|
|
@keyframes fadeInOut {
|
|
0%, 100% { opacity: 0; transform: translateY(10px); }
|
|
20%, 80% { opacity: 1; transform: translateY(0); }
|
|
}
|
|
|
|
/* Authentication status indicator */
|
|
.insertr-auth-status {
|
|
position: fixed;
|
|
bottom: 20px;
|
|
right: 20px;
|
|
background: #1f2937;
|
|
color: white;
|
|
padding: 0.75rem 1rem;
|
|
border-radius: 8px;
|
|
font-size: 0.875rem;
|
|
z-index: 1000;
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
.insertr-auth-status.authenticated {
|
|
background: #10b981;
|
|
}
|
|
|
|
.insertr-auth-status.edit-mode {
|
|
background: #3b82f6;
|
|
} |