Evaluate and Improve Vue Transition Style Management
This issue is a continuation of this conversation: !168752 (comment 2159644127)
Currently, our Vue transition styles are managed in an inconsistent way, leading to potential issues with maintainability, performance, and code clarity. This issue aims to explore and implement a more robust and consistent strategy for handling Vue transition styles across the application.
Problem:
-
Inconsistent Placement: Transition styles are spread between
vue_transitions.scssand page-specific bundles, making it difficult to track and maintain them. - Context-Dependent Styles: Some transitions rely on nested selectors or page-specific context, making them challenging to consolidate in a central location.
- Potential for Conflicts: Modifying or removing styles in one location could unintentionally affect transitions in other parts of the application.
Possible Solutions:
-
Centralize and Enforce with Stylelint:
- Consolidate common transition styles in
vue_transitions.scss. - Implement a Stylelint rule to enforce placement and naming conventions for transition classes.
- Allow exceptions for page-specific transitions with clear documentation.
- Consolidate common transition styles in
-
Create Reusable Utility Classes (or use Tailwind transitions if possible):
- Design and develop a set of reusable utility classes for common transitions, potentially leveraging Tailwind CSS transitions if they meet our needs.
- This would promote consistency and reduce code duplication.
-
Hybrid Approach:
- Combine centralized management for common transitions with page-specific styles for unique or complex cases.
- Use Stylelint to guide developers and maintain consistency.
Next Steps:
-
Evaluation: A working group should assess the proposed solutions, considering factors like:
- Performance implications of each approach
- Complexity of refactoring existing transitions
- Long-term maintainability and scalability
-
Implementation: Develop and execute a plan based on the chosen solution, including:
- Stylelint rule creation and documentation
- Gradual migration of existing transitions
- Updates to the style guide for future guidance
By addressing these concerns, we can ensure our Vue transition styles are managed effectively, promoting consistency, maintainability, and optimal performance across the application.
Edited by James Rushford