SlideShare a Scribd company logo
SCSS Hacks
Caleb
Who I am
Content Outline
❏ What is SCSS
❏ Using SCSS in Visual Studio Code
❏ Linking SASS to Html
❏ SASS Variable
❏ Extending/ Inheritance
❏ Operators
❏ Mixins
❏ Import
❏ Demo
SCSS
“ Sassy Cascading Style Sheets (SCSS) uses block formatting like that of CSS. It
uses braces to denote code blocks and semicolons to separate lines within a
block. The indented syntax and SCSS files are traditionally given the extensions
.sass and .scss, respectively. “
Integrating SCSS with IDE (VS Code)
❏ 1. Install a SASS or Less Transpiler. Use either the Node-sass or less node.js
module
npm install -g node-sass less
❏ 2. Create a simple SASS or Less File
❏ 3. Create Tasks.json file
❏ 4. Run the build task.
Linking SCSS to Html file
<link rel="stylesheet/less" type="text/css" href="styles.less" /> <script
src="less.js" type="text/javascript"></script>
- Adding these 2 lines of code to link the less stylesheet to the html file.
Variables in SCSS (1)
❖ Variable names in SCSS start with $
❖ A variable declaration looks a lot like a property declaration: it’s written
<variable>: <expression>.
❖ Sass variables are imperative, which means if you use a variable and then
change its value, the earlier use will stay the same
Variables in SCSS (2)
❖ Sass variables, like all Sass identifiers, treat hyphens and
underscores as identical
❖ Sass provides the !default flag. This assigns a value to a variable
only if that variable isn’t defined or its value is null. Otherwise, the
existing value will be used. This way, users can set variables
before they import your library to customize its behavior.
Variables in SCSS (3)
❖ Variables declared at the top of a style sheet are global (Scoping)
❖ If you need to set a global variable’s value from within a local scope (such
as in a mixin), you can use the !global flag. A variable declaration flagged
as !global will always assign to the global scope. It cannot be used to
declare a new variable.
❖ The variable-exists() function returns whether a variable with the given
name exists in the current scope, and the global-variable-exists() function
does the same but only for the global scope.
SCSS (Extending/Inheritance)
Using @extend lets you share a set of CSS properties from one selector to
another.
Operators
❏ Colon : operator to define a variable. E.g.: $main-color: blue; (assigning a
color)
❏ Addition (+) operator can be used to concatenate string
❏ Equality Operator ( == ) can be used to test the type of the $font argument.
❏ Modulus Operator (&) can set the property of an element by evaluating an
expression
❏ Comparison Operator can be used to compare numbers
❏ Logical Operators allow us to test multiple conditions within a conditional
expression.
❏ Addition Operator allows us to concatenate strings.
Mixins
❏ Adding groups of CSS Declarations to reuse in a website.
❏ Values are passed in to make mixins more flexible.
❏ To create a mixin, use a @mixin declaration and name the mixin.
❏ A variable $property can be used for us to pass in our mixin of whatever
effects we want to achieve.
❏ After creating the mixin, we can use it as a CSS declaration starting with
@include.
Import (1)
Combine imported file and target file to only render a single CSS file onto the
browser.
Renders your page directly (multiple http requests in internet browsers in CSS)
// styles.scss example of import
@import ‘home/code’, ‘home/lists’;
- Mixins, Variables and functions from file are made available and all its
CSS is made available when the @import is declared.
.
Import (2)
SCSS imports file by URL, not by file path.
Users provide load path on implementation of imports.
Imports are always resolved relative to the current file first though. Load paths
are used only if the files imported are not found.
Advantages
©: KatikeK on Codepen
Advantages
Final Tips
“ SCSS is only powerful when you use a CSS preprocessor to convert SCSS files
to CSS files. CSS files determine how your website look. “
More Reading
1. Theming with SASS: An SCSS Tutorial by Fernando Rivas
2. SASS Documentation on SASS-lang website
3. SASS Guidelines by Hugo Giraudel (https://sass-guidelin.es)
4. 10+ Best Tools and Resources to Compile & Manage SASS, LESS, and Stylus
– CSS Preprocessors by Taisiya (Graygrids Article)
5. Leaner Style Sheet (LESS) documentation (http://lesscss.org/)
6. Custom Importers of node-sass (https://sass-lang.com/documentation/at-
rules/import)

More Related Content

What's hot

High Performance Front-End Development
High Performance Front-End DevelopmentHigh Performance Front-End Development
High Performance Front-End Developmentdrywallbmb
 
Drag and drop file upload with Dropzone in CodeIgniter
Drag and drop file upload with Dropzone in CodeIgniterDrag and drop file upload with Dropzone in CodeIgniter
Drag and drop file upload with Dropzone in CodeIgniter
Yogesh singh
 
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Ayes Chinmay
 
Less css
Less cssLess css
Less css
Amit kumar
 
Node js getting started
Node js getting startedNode js getting started
Node js getting started
Pallavi Srivastava
 
What's a web page made of?
What's a web page made of?What's a web page made of?
What's a web page made of?
Charlie Allen
 
Documentation for installing swizzard cms
Documentation for installing swizzard cmsDocumentation for installing swizzard cms
Documentation for installing swizzard cms
Gary Dragul
 

What's hot (7)

High Performance Front-End Development
High Performance Front-End DevelopmentHigh Performance Front-End Development
High Performance Front-End Development
 
Drag and drop file upload with Dropzone in CodeIgniter
Drag and drop file upload with Dropzone in CodeIgniterDrag and drop file upload with Dropzone in CodeIgniter
Drag and drop file upload with Dropzone in CodeIgniter
 
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
 
Less css
Less cssLess css
Less css
 
Node js getting started
Node js getting startedNode js getting started
Node js getting started
 
What's a web page made of?
What's a web page made of?What's a web page made of?
What's a web page made of?
 
Documentation for installing swizzard cms
Documentation for installing swizzard cmsDocumentation for installing swizzard cms
Documentation for installing swizzard cms
 

Similar to Scss talk CSS Meetup

SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
Amey Parab
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
kavi806657
 
Syntactically Awesome Stylesheet - A workshop by Citytech Software
Syntactically Awesome Stylesheet - A workshop by Citytech SoftwareSyntactically Awesome Stylesheet - A workshop by Citytech Software
Syntactically Awesome Stylesheet - A workshop by Citytech Software
Ritwik Das
 
LESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introductionLESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introduction
rushi7567
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS MethodologyZohar Arad
 
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
William Myers
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sass
Knoldus Inc.
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
Cubet Techno Labs
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentation
JoeSeckelman
 
Advanced sass
Advanced sassAdvanced sass
Advanced sass
Kianosh Pourian
 
Beautifying Sencha Touch
Beautifying Sencha TouchBeautifying Sencha Touch
Beautifying Sencha Touch
Neha Upadhyay
 
TIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideTIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideRohan Chandane
 
Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3
Binu Paul
 

Similar to Scss talk CSS Meetup (20)

SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
 
Syntactically Awesome Stylesheet - A workshop by Citytech Software
Syntactically Awesome Stylesheet - A workshop by Citytech SoftwareSyntactically Awesome Stylesheet - A workshop by Citytech Software
Syntactically Awesome Stylesheet - A workshop by Citytech Software
 
LESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introductionLESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introduction
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS Methodology
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
css-tools
css-toolscss-tools
css-tools
 
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sass
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentation
 
Advanced sass
Advanced sassAdvanced sass
Advanced sass
 
Css
CssCss
Css
 
Beautifying senc
Beautifying sencBeautifying senc
Beautifying senc
 
Beautifying Sencha Touch
Beautifying Sencha TouchBeautifying Sencha Touch
Beautifying Sencha Touch
 
Css
CssCss
Css
 
Css
CssCss
Css
 
TIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideTIBCO General Interface - CSS Guide
TIBCO General Interface - CSS Guide
 
Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3
 

Recently uploaded

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 

Recently uploaded (20)

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 

Scss talk CSS Meetup

  • 3. Content Outline ❏ What is SCSS ❏ Using SCSS in Visual Studio Code ❏ Linking SASS to Html ❏ SASS Variable ❏ Extending/ Inheritance ❏ Operators ❏ Mixins ❏ Import ❏ Demo
  • 4. SCSS “ Sassy Cascading Style Sheets (SCSS) uses block formatting like that of CSS. It uses braces to denote code blocks and semicolons to separate lines within a block. The indented syntax and SCSS files are traditionally given the extensions .sass and .scss, respectively. “
  • 5. Integrating SCSS with IDE (VS Code) ❏ 1. Install a SASS or Less Transpiler. Use either the Node-sass or less node.js module npm install -g node-sass less ❏ 2. Create a simple SASS or Less File ❏ 3. Create Tasks.json file ❏ 4. Run the build task.
  • 6. Linking SCSS to Html file <link rel="stylesheet/less" type="text/css" href="styles.less" /> <script src="less.js" type="text/javascript"></script> - Adding these 2 lines of code to link the less stylesheet to the html file.
  • 7. Variables in SCSS (1) ❖ Variable names in SCSS start with $ ❖ A variable declaration looks a lot like a property declaration: it’s written <variable>: <expression>. ❖ Sass variables are imperative, which means if you use a variable and then change its value, the earlier use will stay the same
  • 8. Variables in SCSS (2) ❖ Sass variables, like all Sass identifiers, treat hyphens and underscores as identical ❖ Sass provides the !default flag. This assigns a value to a variable only if that variable isn’t defined or its value is null. Otherwise, the existing value will be used. This way, users can set variables before they import your library to customize its behavior.
  • 9. Variables in SCSS (3) ❖ Variables declared at the top of a style sheet are global (Scoping) ❖ If you need to set a global variable’s value from within a local scope (such as in a mixin), you can use the !global flag. A variable declaration flagged as !global will always assign to the global scope. It cannot be used to declare a new variable. ❖ The variable-exists() function returns whether a variable with the given name exists in the current scope, and the global-variable-exists() function does the same but only for the global scope.
  • 10. SCSS (Extending/Inheritance) Using @extend lets you share a set of CSS properties from one selector to another.
  • 11. Operators ❏ Colon : operator to define a variable. E.g.: $main-color: blue; (assigning a color) ❏ Addition (+) operator can be used to concatenate string ❏ Equality Operator ( == ) can be used to test the type of the $font argument. ❏ Modulus Operator (&) can set the property of an element by evaluating an expression ❏ Comparison Operator can be used to compare numbers ❏ Logical Operators allow us to test multiple conditions within a conditional expression. ❏ Addition Operator allows us to concatenate strings.
  • 12. Mixins ❏ Adding groups of CSS Declarations to reuse in a website. ❏ Values are passed in to make mixins more flexible. ❏ To create a mixin, use a @mixin declaration and name the mixin. ❏ A variable $property can be used for us to pass in our mixin of whatever effects we want to achieve. ❏ After creating the mixin, we can use it as a CSS declaration starting with @include.
  • 13. Import (1) Combine imported file and target file to only render a single CSS file onto the browser. Renders your page directly (multiple http requests in internet browsers in CSS) // styles.scss example of import @import ‘home/code’, ‘home/lists’; - Mixins, Variables and functions from file are made available and all its CSS is made available when the @import is declared. .
  • 14. Import (2) SCSS imports file by URL, not by file path. Users provide load path on implementation of imports. Imports are always resolved relative to the current file first though. Load paths are used only if the files imported are not found.
  • 17. Final Tips “ SCSS is only powerful when you use a CSS preprocessor to convert SCSS files to CSS files. CSS files determine how your website look. “
  • 18. More Reading 1. Theming with SASS: An SCSS Tutorial by Fernando Rivas 2. SASS Documentation on SASS-lang website 3. SASS Guidelines by Hugo Giraudel (https://sass-guidelin.es) 4. 10+ Best Tools and Resources to Compile & Manage SASS, LESS, and Stylus – CSS Preprocessors by Taisiya (Graygrids Article) 5. Leaner Style Sheet (LESS) documentation (http://lesscss.org/) 6. Custom Importers of node-sass (https://sass-lang.com/documentation/at- rules/import)

Editor's Notes

  1. Reference: https://code.visualstudio.com/docs/languages/css
  2. http://lesscss.org/ https://stackoverflow.com/questions/19215517/attaching-a-sass-scss-to-html-docs
  3. https://sass-lang.com/documentation/variables
  4. https://sass-lang.com/documentation/variables
  5. https://sass-lang.com/documentation/variables
  6. Reference: https://www.sitepoint.com/sass-basics-operators/
  7. https://sass-lang.com/documentation/at-rules/import