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

Refactoring CSS to use SCSS variables #8

Open
rishiraj824 opened this issue Feb 13, 2020 · 2 comments
Open

Refactoring CSS to use SCSS variables #8

rishiraj824 opened this issue Feb 13, 2020 · 2 comments
Assignees

Comments

@rishiraj824
Copy link
Collaborator

  • Look for variables to reuse from variables.scss or add them if something is repetitive
  • If possible make use of mixins
  • Avoid Inline Styling
@rahulakrishna
Copy link
Member

rahulakrishna commented Feb 13, 2020

I'll take this up first.

Here's what I'm planning:

  • A common.scss file.
  • mixins for:
    • padding (in multiples of 4, className="padding-8" and className="padding-left-8 padding-top-16" both should work I think)
    • margin
    • flex (What I'm thinking we should be able to do: className="flex row flex-2 justify-flex-start align-center")
  • Create a colors.scss file.

Also, I am also thinking using styled-components alongside SCSS. What do you think?

@rishiraj824
Copy link
Collaborator Author

rishiraj824 commented Feb 13, 2020

  • colors.scss and padding-{2^x} seems like a great idea.
  • For the flex stuff, let's use mixins itself and use semantic CSS. This might just increase the number of classes per element.
    eg.
@mixin overlay{
position:absolute;
left:0;
right:0;
bottom:0
top:0;
background:rgba(0,0,0.5);
width:100%;
height:100vh;
}
@mixin flex{
 display:flex;
}
.modal {
@include overlay
@include flex-row
}

We can definitely use styled-components for inline and improve things like JS conditional based styling like isActive?'color:blue':'color:black' on components

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants