Проблемы: - События накладывались друг на друга - Пилюли событий были раздуты - CSS вместо SCSS - Inline styles захламляли JS Решение: 1. Новый SCSS модуль _calendar-events.scss - Компактные события: 10px шрифт, 2px padding, 18px min-height - Двухцветная схема через data-атрибуты - Управление стеком: max-height 72px (~4 события) - Hover, анимации, адаптивность - Кастомные scrollbar для popover 2. Упрощённый JavaScript - Только цвета через inline styles - Всё остальное через SCSS (padding, border, shadow) - Data-атрибуты: [data-has-calendar-color], [data-recurrence] - Убраны все inline hover-листенеры 3. Оптимизация FullCalendar - dayMaxEvents: true - автоматически '+N еще' - dayMaxEventRows: 4 - максимум 4 строки - eventMaxStack: 3 - до 3 в стеке - Ячейка дня: min-height 80px - События: max-height 72px контейнера 4. Компактный дизайн - Граница календаря: 3px (было 4px) - Padding: 2px 4px (было 6px 4px) - Font-size: 10px (было 11px) - Line-clamp: 2 строки (было 3) - Margin: 1px 2px (плотнее) 5. Производительность - will-change для GPU ускорения - Убраны лишние event listeners - CSS animations вместо JS - Transition только на hover Результат: ✅ События компактные и не накладываются ✅ Читаемость сохранена (белый текст + тень) ✅ Двухцветная схема работает (граница + фон) ✅ +N еще при >4 событиях в день ✅ SCSS архитектура (не inline CSS) ✅ Быстрые hover эффекты через CSS
CSS Architecture Documentation
🎯 Overview
Status: ✅ SCSS Migration Complete (January 2026)
Architecture: 100% SCSS-based, compiled to CSS
This folder contains compiled CSS files only. All source styles are written in SCSS and located in ../scss/.
📁 Directory Structure
css/
├── app.css ← Compiled from scss/main.scss (95 KB)
├── app.css.map ← Source map for debugging
├── bootstrap-custom.css ← Compiled from scss/bootstrap-custom.scss (301 KB)
├── bootstrap-custom.css.map ← Source map for debugging
├── components/ ← Legacy folder (kept for git structure)
│ └── .gitkeep
└── README.md ← This file
🔄 Migration History
Before (Phase 1-5)
- 28+ individual CSS files
- Duplication across components
- Manual maintenance
After (Phase 6 - January 2026)
- ✅ 2 compiled CSS files (app.css + bootstrap-custom.css)
- ✅ 30 SCSS component modules
- ✅ Centralized build system
- ✅ 0% duplication
📦 Compiled Files
📦 Compiled Files
1. app.css (95 KB compressed)
Source: ../scss/main.scss
Contains: All application styles
Includes:
- CSS Custom Properties (variables)
- Layout system (grid, navbar, sidebar, rightbar)
- 30 SCSS components
- Spacing utilities
- Responsive styles
Build Command:
cd ../
npm run build:app
2. bootstrap-custom.css (301 KB compressed)
Source: ../scss/bootstrap-custom.scss
Contains: Bootstrap 5.3.3 with customizations
Customizations:
- 8px grid spacing system
- Custom color palette
- Component overrides
- Typography adjustments
Build Command:
cd ../
npm run build:bootstrap
🏗️ SCSS Architecture
All source styles are in ../scss/:
scss/
├── main.scss ← Entry point for app.css
├── bootstrap-custom.scss ← Entry point for bootstrap
├── custom-bootstrap.scss ← Bootstrap customizations
├── abstracts/
│ ├── _variables.scss ← SCSS variables ($var)
│ ├── _css-variables.scss ← CSS Custom Properties (--var)
│ ├── _mixins.scss ← Reusable mixins
│ └── _index.scss ← Exports all abstracts
├── layout/
│ ├── _base-app.scss ← Main app grid layout
│ └── _chat-layout.scss ← Chat-specific layout
└── components/
├── _navbar.scss ← Navigation bar
├── _sidebar.scss ← Left sidebar
├── _page-header.scss ← Page headers
├── _buttons.scss ← Button styles
├── _cards.scss ← Card components
├── _modals.scss ← Modal dialogs
├── _notifications.scss ← Notification center
├── _layout-spacing.scss ← Spacing utilities
├── _spacing-utils.scss ← Utility classes
├── _rightbar-calendar.scss ← Calendar in rightbar
└── ... (30 total components)
🔧 Development Workflow
1. Edit SCSS files
# Navigate to static folder
cd backend/static
# Edit any SCSS file in scss/ folder
# Example: scss/components/_buttons.scss
2. Build CSS
# Build app.css once
npm run build:app
# Or watch for changes (auto-rebuild)
npm run dev
3. Check output
# Verify compilation
ls -lh css/app.css
# Check for errors in terminal
📝 Template Usage
In base.html
{% load static %}
<head>
<!-- Bootstrap custom -->
<link rel="stylesheet" href="{% static 'css/bootstrap-custom.css' %}">
<!-- Application styles -->
<link rel="stylesheet" href="{% static 'css/app.css' %}">
</head>
Note: Do NOT link individual component CSS files - everything is in app.css!
🎨 CSS Variables
All CSS Custom Properties are compiled into app.css from scss/abstracts/_css-variables.scss:
Spacing (8px grid)
--space-1: 4px
--space-2: 8px
--space-3: 12px
--space-4: 16px
--space-5: 24px
Layout
--navbar-h: 60px
--sidebar-w: 200px
--rightbar-w: 350px
--layout-gap: 16px
--layout-padding-y: 24px
Components
--card-padding: 16px
--card-radius: 14px
--feed-radius: 18px
🚀 Quick Reference
Build Commands
# Build everything
npm run build:app && npm run build:bootstrap
# Watch mode (development)
npm run dev
# Build app.css only
npm run build:app
# Build bootstrap only
npm run build:bootstrap
File Sizes
- app.css: 95 KB compressed
- bootstrap-custom.css: 301 KB compressed
- Total: 396 KB
Adding New Component
- Create
scss/components/_new-component.scss - Add
@import 'components/new-component';toscss/main.scss - Run
npm run build:app
⚠️ Important Notes
- Never edit CSS files directly - they are auto-generated
- Always edit SCSS files in
../scss/folder - Always rebuild after SCSS changes
- Source maps included for debugging (*.css.map)
- Components folder kept for git structure only
📚 Documentation
- SCSS Quick Reference: ../../docs/guides/SCSS_QUICK_REFERENCE.md
- Migration Complete: ../../docs/completed/CSS_TO_SCSS_MIGRATION_100_PERCENT_COMPLETE.md
- Phase 6 Report: ../../docs/reports/CSS_TO_SCSS_PHASE6_FINAL_CLEANUP.md
🔍 Troubleshooting
Styles not applying?
- Check if CSS files are up to date:
npm run build:app - Clear browser cache (Ctrl+F5)
- Check browser DevTools for CSS loading errors
Build errors?
- Check SCSS syntax in modified files
- Ensure all imports exist in
main.scss - Check terminal output for specific error
Variables not working?
- Ensure you're using
var(--variable-name)syntax - Check that
_css-variables.scssis imported - Verify variable is defined in
scss/abstracts/_css-variables.scss
📊 Statistics
- SCSS Components: 30 files
- Total SCSS Lines: ~4,768 lines
- CSS Files: 2 (compiled)
- Duplication: 0%
- Build Time: ~2 seconds
Last Updated: January 15, 2026
Migration Status: ✅ Complete
Architecture: SCSS → Compiled CSS
Maintainer: Development Team