SlideShare a Scribd company logo
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
Beautifying Sencha Touch
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:
Beautifying Sencha Touch
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 
.loginButton{ 
webkit-border-radius: 
0.2em!important; 
border-radius: 0.2em!important; 
height:2.7em; 
background-image: -webkit-gradient( 
linear, 50% 0%, 50% 
100%, color-stop(0%, white), 
color-stop(2%, #FDFDFD), 
color-stop(100%, 
#D9D9D9))!important; 
} 
Scss for button 
@include sencha-button-ui(' 
loginButton', #2D7AB4, 
'glossy');
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

PPTX
Beautifying senc
Rachana Upadhyay
 
PPTX
Less presentation
Todd Shelton
 
PPTX
.Less - CSS done right
Daniel Hölbling
 
PPTX
Sass: Introduction
BalaKrishna Kolliboina
 
PPT
LESS CSS
Mathi Rajalingam
 
PPTX
Introducing grunt, npm and sass
priyanka1452
 
PPTX
Sass
Tayseer_Emam
 
KEY
Sears Front End Changes
Lance Ennen
 
Beautifying senc
Rachana Upadhyay
 
Less presentation
Todd Shelton
 
.Less - CSS done right
Daniel Hölbling
 
Sass: Introduction
BalaKrishna Kolliboina
 
Introducing grunt, npm and sass
priyanka1452
 
Sears Front End Changes
Lance Ennen
 

What's hot (20)

PPTX
SASS - Syntactically Awesome Stylesheet
Neha Sharma
 
PDF
Tech talk on Tailwind CSS
Squareboat
 
PPTX
Syntactically awesome stylesheets (Sass)
Tahmina Khatoon
 
PDF
Less vs sass
Aya Edamoto
 
PDF
Compass n Sass
Pradeep Saraswathi
 
PPTX
Write LESS. DO more.
Eugene Nor
 
PDF
Intro to Sails.js
DevOpsDays Austin 2014
 
KEY
Advanced sass
Kianosh Pourian
 
PDF
Create SASSy web parts in SPFx
Stefan Bauer
 
PPTX
Class15
Jiyeon Lee
 
PDF
Use SVG to Bring the Web to Life (Quinton Jason Jr)
Future Insights
 
PPTX
HTML/CSS for WordPress
Kanchha kaji Prajapati
 
PDF
Sass and compass workshop
Shaho Toofani
 
PDF
The way to be a developer "What I Need"
egyappassiut
 
PDF
Getting Sassy with CSS
Julie Cameron
 
PPTX
Make your CSS beautiful again
spannerspace Hales
 
PDF
Switch Away from Icon Fonts to SVG
Exove
 
PPTX
An Overview on Nuxt.js
Squash Apps Pvt Ltd
 
PDF
Going Multi-Tenant with dotCMS
dotCMS
 
PPTX
CSS Generator Tools
lillianabe
 
SASS - Syntactically Awesome Stylesheet
Neha Sharma
 
Tech talk on Tailwind CSS
Squareboat
 
Syntactically awesome stylesheets (Sass)
Tahmina Khatoon
 
Less vs sass
Aya Edamoto
 
Compass n Sass
Pradeep Saraswathi
 
Write LESS. DO more.
Eugene Nor
 
Intro to Sails.js
DevOpsDays Austin 2014
 
Advanced sass
Kianosh Pourian
 
Create SASSy web parts in SPFx
Stefan Bauer
 
Class15
Jiyeon Lee
 
Use SVG to Bring the Web to Life (Quinton Jason Jr)
Future Insights
 
HTML/CSS for WordPress
Kanchha kaji Prajapati
 
Sass and compass workshop
Shaho Toofani
 
The way to be a developer "What I Need"
egyappassiut
 
Getting Sassy with CSS
Julie Cameron
 
Make your CSS beautiful again
spannerspace Hales
 
Switch Away from Icon Fonts to SVG
Exove
 
An Overview on Nuxt.js
Squash Apps Pvt Ltd
 
Going Multi-Tenant with dotCMS
dotCMS
 
CSS Generator Tools
lillianabe
 
Ad

Viewers also liked (9)

PDF
Untitled Presentation
Frankie Simon
 
DOCX
Blogging experience
Frankie Simon
 
PPTX
Sencha Touch MVC
Neha Upadhyay
 
PDF
Toy | Kitchenware Wholesalers Manchester
shonnbrothersmanchesterltd
 
PPTX
Azure Mobile Services
fatih demir
 
ODP
P3 (1)
rogervendrell
 
PPTX
Presentation2
Frankie Simon
 
PDF
SAP PP No 71 Tahun 2010
desak arsani
 
PPTX
情報システム創成研究分野への誘い
情報システム創成研究分野
 
Untitled Presentation
Frankie Simon
 
Blogging experience
Frankie Simon
 
Sencha Touch MVC
Neha Upadhyay
 
Toy | Kitchenware Wholesalers Manchester
shonnbrothersmanchesterltd
 
Azure Mobile Services
fatih demir
 
Presentation2
Frankie Simon
 
SAP PP No 71 Tahun 2010
desak arsani
 
情報システム創成研究分野への誘い
情報システム創成研究分野
 
Ad

Similar to Beautifying Sencha Touch (20)

PPT
UNIT 3.ppt
kavi806657
 
PPTX
BDUG Responsive Web Theming - 7/23/12
ucbdrupal
 
KEY
Authoring Stylesheets with Compass & Sass
chriseppstein
 
PDF
slides-students-C04.pdf
MonkeyDLuffy708724
 
PPTX
SCSS Implementation
Amey Parab
 
PPTX
Syntactically Awesome Stylesheet - A workshop by Citytech Software
Ritwik Das
 
KEY
Advanced sass/compass
Nick Cooley
 
PDF
Intro to Sass for WordPress Developers
Suzette Franck
 
PDF
CSS Workflow. Pre & Post
Anton Dosov
 
DOCX
css-tools
Desarae Veit
 
PPTX
Scss talk CSS Meetup
Caleb Yang
 
PPTX
Joes sass presentation
JoeSeckelman
 
PDF
SASS, Compass, Gulp, Greensock
Marco Pinheiro
 
PPTX
Sass:-Syntactically Awesome Stylesheet by Shafeeq
DignitasDigital1
 
PPTX
Post css - Getting start with PostCSS
Neha Sharma
 
PDF
Responsive Design in Drupal with Zen and Zen Grids
Suzanne Dergacheva
 
PDF
Using Sass in Your WordPress Projects
Jeremy Green
 
PPS
Why are we using Sass to create Grid Frameworks?
sharjeet
 
PPTX
Sass_Cubet seminar
Cubet Techno Labs
 
PDF
Less(CSS Pre Processor) Introduction
rushi7567
 
UNIT 3.ppt
kavi806657
 
BDUG Responsive Web Theming - 7/23/12
ucbdrupal
 
Authoring Stylesheets with Compass & Sass
chriseppstein
 
slides-students-C04.pdf
MonkeyDLuffy708724
 
SCSS Implementation
Amey Parab
 
Syntactically Awesome Stylesheet - A workshop by Citytech Software
Ritwik Das
 
Advanced sass/compass
Nick Cooley
 
Intro to Sass for WordPress Developers
Suzette Franck
 
CSS Workflow. Pre & Post
Anton Dosov
 
css-tools
Desarae Veit
 
Scss talk CSS Meetup
Caleb Yang
 
Joes sass presentation
JoeSeckelman
 
SASS, Compass, Gulp, Greensock
Marco Pinheiro
 
Sass:-Syntactically Awesome Stylesheet by Shafeeq
DignitasDigital1
 
Post css - Getting start with PostCSS
Neha Sharma
 
Responsive Design in Drupal with Zen and Zen Grids
Suzanne Dergacheva
 
Using Sass in Your WordPress Projects
Jeremy Green
 
Why are we using Sass to create Grid Frameworks?
sharjeet
 
Sass_Cubet seminar
Cubet Techno Labs
 
Less(CSS Pre Processor) Introduction
rushi7567
 

Recently uploaded (20)

PDF
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
PDF
Packaging Tips for Stainless Steel Tubes and Pipes
heavymetalsandtubes
 
PDF
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
PPTX
Inventory management chapter in automation and robotics.
atisht0104
 
PDF
Top 10 read articles In Managing Information Technology.pdf
IJMIT JOURNAL
 
PDF
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
PDF
Biodegradable Plastics: Innovations and Market Potential (www.kiu.ac.ug)
publication11
 
PDF
Zero carbon Building Design Guidelines V4
BassemOsman1
 
PPTX
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
PDF
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
PPTX
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
PPTX
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
PPTX
22PCOAM21 Session 1 Data Management.pptx
Guru Nanak Technical Institutions
 
PPTX
Tunnel Ventilation System in Kanpur Metro
220105053
 
PDF
Zero Carbon Building Performance standard
BassemOsman1
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
Packaging Tips for Stainless Steel Tubes and Pipes
heavymetalsandtubes
 
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
Inventory management chapter in automation and robotics.
atisht0104
 
Top 10 read articles In Managing Information Technology.pdf
IJMIT JOURNAL
 
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
Biodegradable Plastics: Innovations and Market Potential (www.kiu.ac.ug)
publication11
 
Zero carbon Building Design Guidelines V4
BassemOsman1
 
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
22PCOAM21 Session 1 Data Management.pptx
Guru Nanak Technical Institutions
 
Tunnel Ventilation System in Kanpur Metro
220105053
 
Zero Carbon Building Performance standard
BassemOsman1
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 

Beautifying Sencha Touch

  • 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
  • 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:
  • 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 .loginButton{ webkit-border-radius: 0.2em!important; border-radius: 0.2em!important; height:2.7em; background-image: -webkit-gradient( linear, 50% 0%, 50% 100%, color-stop(0%, white), color-stop(2%, #FDFDFD), color-stop(100%, #D9D9D9))!important; } Scss for button @include sencha-button-ui(' loginButton', #2D7AB4, 'glossy');
  • 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.