-
Notifications
You must be signed in to change notification settings - Fork 28
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 with Sass #15
Comments
Refactoring your front-end styles to use Sass (Syntactically Awesome Style Sheets) can enhance your development workflow by allowing for better organization, variables, nesting, and mixins. Here’s a step-by-step guide to refactor your CSS to Sass for your finance full-stack web app. Step 1: Install SassIf you haven't already, you need to install Sass. You can do this via npm: npm install sass --save-dev Step 2: Set Up Your File StructureCreate a folder structure for your Sass files. A common setup might look like this:
Step 3: Create Partial Files
Step 4: Main Sass FileIn your @import 'partials/variables';
@import 'partials/mixins';
@import 'partials/base';
@import 'partials/layout';
@import 'partials/components'; Step 5: Compile Sass to CSSYou can compile your Sass files to CSS using the command line: npx sass styles/main.scss styles/main.css You might also want to set up a watch command to automatically compile Sass files when changes are made: npx sass --watch styles/main.scss styles/main.css Step 6: Update HTML LinksEnsure that your HTML files link to the compiled CSS file: <link rel="stylesheet" href="styles/main.css"> Step 7: Remove Old CSSOnce you’ve confirmed that everything works correctly with Sass, you can remove any old CSS files that are no longer needed. Additional Tips
ConclusionRefactoring to Sass will make your stylesheets more maintainable and scalable. |
Remove the need for Bootstrap and practice Flexbox and Grid Layouts with Sass
Follow the styling guide from robinhood itself
The text was updated successfully, but these errors were encountered: