EnAccess / EnAccess/micropowermanager
[Feature Request]: Refactor SCSS code organization to reduce redundancy and improve maintainability
- Dominant language
- PHP
- Stars
- 27
- Forks
- 19
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 27
Description
### Preflight Checklist
- [x] I have read the [Contributing Guidelines](https://github.com/EnAccess/micropowermanager/blob/main/CONTRIBUTING.md) for this project, if it exists.
- [x] I agree to follow the [Code of Conduct](https://github.com/EnAccess/micropowermanager/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [x] I have searched the [issue tracker](https://github.com/EnAccess/micropowermanager/issues) for a feature request that matches the one I want to file, without success.
### Problem Description
Currently, the project includes multiple "global" SCSS files located in `src/assets/sass.` While having global styles for things like variables (e.g., color schemes, fonts) makes sense, there seems to be redundancy and inconsistency in how styles are applied.
For example:
Components like `Side` and `Navbar` have SCSS files in the global Sass directory.
At the same time, these components also include their own scoped styling within their respective .`vue` files.
This setup may lead to:
Redundant or conflicting styles.
Increased difficulty maintaining and scaling the codebase.
A lack of clarity on where specific styles are defined or modified.
### Proposed Solution
Refactor the current styling structure to:
Keep truly global definitions (e.g., variables, mixins) in a dedicated global SCSS file (e.g., `_variables.scss`, `_mixins.scss`).
Move all component-specific styles into their corresponding `.vue` files using `` or CSS Modules if applicable.
Remove redundant SCSS files from `src/assets/sass` that are only used by individual components.
This approach promotes better encapsulation, readability, and maintainability.
### Alternatives Considered
- **Keep shared layout styles in a centralized location:** If certain layout styles (like shared widths, paddings, or breakpoints) are reused across many components, consider keeping those in a shared partial and importing them where needed.
- **Hybrid approach:** Maintain a balance by keeping base styles and utilities globally while enforcing local styles for component-specific customization.
### Additional Information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.