SlideShare a Scribd company logo
1 of 17
Beautifying your Sencha
App using scss
- By Neha Upadhyay
Topics to be covered
•

•
•
•
•
•

What is scss
Environment setup for compass
How to use compass in sencha app
Scss mixins in sencha
Css variables in sencha
Theming in sencha.
What is scss
• Scss is a nested css metalanguage that
supports variable, mixins, nesting and
selector in heritance.
• Every valid css is a valid scss.
• A scss file has .scss extension.
• A scss file has to be compiled using
compass which will generate/update the
repective css file.
Environment setup for
Compass
1. Install compass using ruby gem installer.
You will have to download the installer
from http://rubyinstaller.org/ for windows
Mac machines don’t need to install it.
2. After finishing the setup please check if
your environment variable are set if not
then please set your path to Ruby193bin
3. Open your command window and type
gem command.
4. Say gem install compass to install compass
How to use compass in
sencha app
• If sencha application is created using
sencha sdk tools i.e using generate app
command in command window then
there is a sass project in resources/scss
directory.
• NOTE: Compass commands can be
executed only in a valid sass project
directory.
Continued
• The directory already contains a scss file
name app.scss.
• It includes all the scss files which provide
the default blue theme for sencha
application.
• It looks like this
Continued
• You can create your own .scss file in the
same scss directory and when you compile
that file using compass the corresponding
css file will be generated/updated in the
resources/css
• And you just have to include this css file in
your index.html.
How to compile a scss file?
• To compile the scss file you have to go to that
path in your command window.
• Check if your compass command is working.
• Then execute compass compile command
• This command will compile all scss files in
that directory.
• You can also execute compass watch commad
it compiles your scss file as you change it.
SCSS Mixins in sencha
• In scss mixins allow you to re-use whole
chunks of CSS, properties or selectors. You
can even give them arguments.
• Eg: Here $name is a variable
@mixin pictos-iconmask($name) {
.x-tab .x-button-icon.#{$name},
.x-button .x-button-icon.x-icon-mask.#{$name} {
-webkit-mask-image:
theme_image('default', "pictos/" + $name + ".png");
}
}
Continued
• Sencha provides such mixins for every
component using which we can create new
ui themes.
• All these mixins are listed in
documentation of sencha.
• They look like this:
Why use scss mixin ?
One may ask why use mixin provided by
sencha to style components. It can also be
done by normal css. The answere is:
• While using mixin we just have to pass
some color or gradient name and sencha
does the css itself. Hence the
styles, gradients created work for android
as well as iOS.
Continued…
• While writing the css for sencha
components one has to override many
sencha styles and sometimes its very
difficult to trace which classes or css
properties have to be overrided.
• For every mixin name can be used to apply
some specific css propeties and also for
selector inheritance which makes it very
easy to overide sencha classes.
Continued…
Css for button

Scss for button

.loginButton{
webkit-border-radius:
0.2em!important;
border-radius: 0.2em!important;
height:2.7em;
background-image: -webkitgradient(linear, 50% 0%, 50%
100%, colorstop(0%, white), colorstop(2%, #FDFDFD), colorstop(100%, #D9D9D9))!import
ant;
}

@include sencha-buttonui('loginButton', #2D7AB4, 'glos
sy');
Css variables in sencha
• Like mixin sencha also provides css vars or
variable for styling in sencha.
• Every component has its own set of css
variable which can be used to change the
style of that component.
• Css variables in sencha are used for
theming of the sencha application as these
variable are global.
Theming in sencha
• I still have to learn it.

More Related Content

What's hot

Sears Front End Changes
Sears Front End ChangesSears Front End Changes
Sears Front End Changes
Lance Ennen
 

What's hot (20)

Getting SASSy with front end development
Getting SASSy with front end developmentGetting SASSy with front end development
Getting SASSy with front end development
 
Sears Front End Changes
Sears Front End ChangesSears Front End Changes
Sears Front End Changes
 
Tech talk on Tailwind CSS
Tech talk on Tailwind CSSTech talk on Tailwind CSS
Tech talk on Tailwind CSS
 
SASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome StylesheetSASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome Stylesheet
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)
 
Less vs sass
Less vs sassLess vs sass
Less vs sass
 
Project development - preparing hell dish together – Oleksii Dashkevych
Project development - preparing hell dish together – Oleksii DashkevychProject development - preparing hell dish together – Oleksii Dashkevych
Project development - preparing hell dish together – Oleksii Dashkevych
 
WordPress Bootcamp Quiz
WordPress Bootcamp QuizWordPress Bootcamp Quiz
WordPress Bootcamp Quiz
 
Write LESS. DO more.
Write LESS. DO more.Write LESS. DO more.
Write LESS. DO more.
 
Compass n Sass
Compass n SassCompass n Sass
Compass n Sass
 
Intro to Sails.js
Intro to Sails.jsIntro to Sails.js
Intro to Sails.js
 
'Less' css
'Less' css'Less' css
'Less' css
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFx
 
Sass Beginner Guide
Sass Beginner GuideSass Beginner Guide
Sass Beginner Guide
 
Getting Sassy with CSS
Getting Sassy with CSSGetting Sassy with CSS
Getting Sassy with CSS
 
Intro to EmberJS
Intro to EmberJSIntro to EmberJS
Intro to EmberJS
 
Advanced sass
Advanced sassAdvanced sass
Advanced sass
 
Be Happy With Ruby on Rails - Ecosystem
Be Happy With Ruby on Rails - EcosystemBe Happy With Ruby on Rails - Ecosystem
Be Happy With Ruby on Rails - Ecosystem
 
Sass and compass workshop
Sass and compass workshopSass and compass workshop
Sass and compass workshop
 
Class15
Class15Class15
Class15
 

Viewers also liked

Integrity without it nothing works
Integrity without it nothing worksIntegrity without it nothing works
Integrity without it nothing works
Antonio Gálvez
 
Nutrilite business plan v9 2013 for downline
Nutrilite business plan v9 2013 for downlineNutrilite business plan v9 2013 for downline
Nutrilite business plan v9 2013 for downline
Jack Tran
 
Vai tu zini, kāds līderis gribi būt
Vai tu zini, kāds līderis gribi būtVai tu zini, kāds līderis gribi būt
Vai tu zini, kāds līderis gribi būt
Laura Kursite
 
A day in the life of on utp
A day in the life of on utpA day in the life of on utp
A day in the life of on utp
cata1623
 
การสื่อสาร
การสื่อสารการสื่อสาร
การสื่อสาร
TuaLek Kitkoot
 
Find Your Ideas, Inspirations, and Imaginations with Goodrich Global Indonesi...
Find Your Ideas, Inspirations, and Imaginations with Goodrich Global Indonesi...Find Your Ideas, Inspirations, and Imaginations with Goodrich Global Indonesi...
Find Your Ideas, Inspirations, and Imaginations with Goodrich Global Indonesi...
Gunawan Tan
 
2012 2013 nfp presentation
2012 2013 nfp presentation2012 2013 nfp presentation
2012 2013 nfp presentation
George Blieka
 
Projectm6 2-2554 tom's
Projectm6 2-2554 tom'sProjectm6 2-2554 tom's
Projectm6 2-2554 tom's
Theyok Tanya
 

Viewers also liked (20)

Integrity without it nothing works
Integrity without it nothing worksIntegrity without it nothing works
Integrity without it nothing works
 
cells
cellscells
cells
 
Par to kas TU ESI
Par to kas TU ESIPar to kas TU ESI
Par to kas TU ESI
 
Modern Sofas & Chairs
Modern Sofas & ChairsModern Sofas & Chairs
Modern Sofas & Chairs
 
Nutrilite business plan v9 2013 for downline
Nutrilite business plan v9 2013 for downlineNutrilite business plan v9 2013 for downline
Nutrilite business plan v9 2013 for downline
 
Library furniture
Library furnitureLibrary furniture
Library furniture
 
Proiecte 27 iunie cafeneaua publica
Proiecte 27 iunie cafeneaua publicaProiecte 27 iunie cafeneaua publica
Proiecte 27 iunie cafeneaua publica
 
Vai tu zini, kāds līderis gribi būt
Vai tu zini, kāds līderis gribi būtVai tu zini, kāds līderis gribi būt
Vai tu zini, kāds līderis gribi būt
 
เรื่องวิทยาศาสตร์น่ารู้
 เรื่องวิทยาศาสตร์น่ารู้ เรื่องวิทยาศาสตร์น่ารู้
เรื่องวิทยาศาสตร์น่ารู้
 
A day in the life of on utp
A day in the life of on utpA day in the life of on utp
A day in the life of on utp
 
El mundo
El mundoEl mundo
El mundo
 
Amazing prediction
Amazing predictionAmazing prediction
Amazing prediction
 
ว5
ว5ว5
ว5
 
การสื่อสาร
การสื่อสารการสื่อสาร
การสื่อสาร
 
Find Your Ideas, Inspirations, and Imaginations with Goodrich Global Indonesi...
Find Your Ideas, Inspirations, and Imaginations with Goodrich Global Indonesi...Find Your Ideas, Inspirations, and Imaginations with Goodrich Global Indonesi...
Find Your Ideas, Inspirations, and Imaginations with Goodrich Global Indonesi...
 
2012 2013 nfp presentation
2012 2013 nfp presentation2012 2013 nfp presentation
2012 2013 nfp presentation
 
integral
integralintegral
integral
 
Chinese Automotive market
Chinese Automotive marketChinese Automotive market
Chinese Automotive market
 
Yuni bru integral
Yuni bru integralYuni bru integral
Yuni bru integral
 
Projectm6 2-2554 tom's
Projectm6 2-2554 tom'sProjectm6 2-2554 tom's
Projectm6 2-2554 tom's
 

Similar to Beautifying senc

Similar to Beautifying senc (20)

Beautifying Sencha Touch
Beautifying Sencha TouchBeautifying Sencha Touch
Beautifying Sencha Touch
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
 
BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12
 
slides-students-C04.pdf
slides-students-C04.pdfslides-students-C04.pdf
slides-students-C04.pdf
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
 
CSS Workflow. Pre & Post
CSS Workflow. Pre & PostCSS Workflow. Pre & Post
CSS Workflow. Pre & Post
 
css-tools
css-toolscss-tools
css-tools
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
 
Scss talk CSS Meetup
Scss talk CSS Meetup Scss talk CSS Meetup
Scss talk CSS Meetup
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentation
 
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
 
Responsive Design in Drupal with Zen and Zen Grids
Responsive Design in Drupal with Zen and Zen GridsResponsive Design in Drupal with Zen and Zen Grids
Responsive Design in Drupal with Zen and Zen Grids
 
Sass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqSass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by Shafeeq
 
Post css - Getting start with PostCSS
Post css - Getting start with PostCSSPost css - Getting start with PostCSS
Post css - Getting start with PostCSS
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
 
Css framework
Css frameworkCss framework
Css framework
 
Css framework
Css frameworkCss framework
Css framework
 

Recently uploaded

Recently uploaded (20)

Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 

Beautifying senc

  • 1. Beautifying your Sencha App using scss - By Neha Upadhyay
  • 2. Topics to be covered • • • • • • What is scss Environment setup for compass How to use compass in sencha app Scss mixins in sencha Css variables in sencha Theming in sencha.
  • 3. What is scss • Scss is a nested css metalanguage that supports variable, mixins, nesting and selector in heritance. • Every valid css is a valid scss. • A scss file has .scss extension. • A scss file has to be compiled using compass which will generate/update the repective css file.
  • 4. Environment setup for Compass 1. Install compass using ruby gem installer. You will have to download the installer from http://rubyinstaller.org/ for windows Mac machines don’t need to install it. 2. After finishing the setup please check if your environment variable are set if not then please set your path to Ruby193bin 3. Open your command window and type gem command. 4. Say gem install compass to install compass
  • 5. How to use compass in sencha app • If sencha application is created using sencha sdk tools i.e using generate app command in command window then there is a sass project in resources/scss directory. • NOTE: Compass commands can be executed only in a valid sass project directory.
  • 6. Continued • The directory already contains a scss file name app.scss. • It includes all the scss files which provide the default blue theme for sencha application. • It looks like this
  • 7.
  • 8. Continued • You can create your own .scss file in the same scss directory and when you compile that file using compass the corresponding css file will be generated/updated in the resources/css • And you just have to include this css file in your index.html.
  • 9. How to compile a scss file? • To compile the scss file you have to go to that path in your command window. • Check if your compass command is working. • Then execute compass compile command • This command will compile all scss files in that directory. • You can also execute compass watch commad it compiles your scss file as you change it.
  • 10. SCSS Mixins in sencha • In scss mixins allow you to re-use whole chunks of CSS, properties or selectors. You can even give them arguments. • Eg: Here $name is a variable @mixin pictos-iconmask($name) { .x-tab .x-button-icon.#{$name}, .x-button .x-button-icon.x-icon-mask.#{$name} { -webkit-mask-image: theme_image('default', "pictos/" + $name + ".png"); } }
  • 11. Continued • Sencha provides such mixins for every component using which we can create new ui themes. • All these mixins are listed in documentation of sencha. • They look like this:
  • 12.
  • 13. Why use scss mixin ? One may ask why use mixin provided by sencha to style components. It can also be done by normal css. The answere is: • While using mixin we just have to pass some color or gradient name and sencha does the css itself. Hence the styles, gradients created work for android as well as iOS.
  • 14. Continued… • While writing the css for sencha components one has to override many sencha styles and sometimes its very difficult to trace which classes or css properties have to be overrided. • For every mixin name can be used to apply some specific css propeties and also for selector inheritance which makes it very easy to overide sencha classes.
  • 15. Continued… Css for button Scss for button .loginButton{ webkit-border-radius: 0.2em!important; border-radius: 0.2em!important; height:2.7em; background-image: -webkitgradient(linear, 50% 0%, 50% 100%, colorstop(0%, white), colorstop(2%, #FDFDFD), colorstop(100%, #D9D9D9))!import ant; } @include sencha-buttonui('loginButton', #2D7AB4, 'glos sy');
  • 16. Css variables in sencha • Like mixin sencha also provides css vars or variable for styling in sencha. • Every component has its own set of css variable which can be used to change the style of that component. • Css variables in sencha are used for theming of the sencha application as these variable are global.
  • 17. Theming in sencha • I still have to learn it.