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)

UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
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...
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 

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.