Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Sass styling to reduce duplication #123

Open
7 tasks
nicholaschiang opened this issue Sep 30, 2020 · 1 comment
Open
7 tasks

Refactor Sass styling to reduce duplication #123

nicholaschiang opened this issue Sep 30, 2020 · 1 comment
Assignees
Labels
backlog Low priority implementation changes

Comments

@nicholaschiang
Copy link
Member

Is your feature request related to a problem? Please describe.

I've got a lot of Sass styling that's the same across multiple components (e.g. components/profile/profile.module.scss is very similar to components/settings/settings.module.scss because the UI on both pages looks the same).

Right now, I simply copy and modify existing stylesheets (to style new components) instead of taking advantage of Sass code re-usability features (e.g. mixins and variables).

Describe the solution you'd like

In order to maintain consistency across the entire app and reduce code duplication, I should:

  • Research best ways to structure reusable mixins, variables, functions, etc (e.g. best practices used by MWC).
  • Convert app-wide Sass variables (currently defined in styles/config.scss) to CSS variables (e.g. to fix Add dark mode #79).
  • Update import resolutions and styling file structure:

Additional context
Ideally, I'd also work on reducing bundle sizes by somehow chunking RMWC's style sheets with their components too. Right now, this isn't possible because mdc defines global classes (and thus all global stylesheets must be imported into _app.tsx which loads them on every page). But, that's outside the scope of this issue.

@nicholaschiang nicholaschiang added type:enhancement p3 Normal priority tasks labels Sep 30, 2020
@nicholaschiang nicholaschiang self-assigned this Sep 30, 2020
@nicholaschiang
Copy link
Member Author

I should also use the new Next.js css features to code-split RMWC styling into the pages that need it.

For now, that's a low priority because most pages require all of those styles anyways (and I don't think those styles are very large anyway).

@nicholaschiang nicholaschiang added backlog Low priority implementation changes and removed category:front-end p3 Normal priority tasks labels May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Low priority implementation changes
Projects
None yet
Development

No branches or pull requests

1 participant