SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
Matthias Oßwald, SAP
June 30, 2017
UI5 Theming
Explained
2
UI5 Theming Explained
Agenda
Less.js Introduction
Theme Structure & Inheritance
Theme Parameters
Custom Themes
Further Resources
Less.js
4
Less.js
Open Source CSS pre-processor
Extends the CSS language
Provides variables, functions (lighten, darken, saturate, contrast) and mixins
http://lesscss.org/
5
Less.js
Open Source CSS pre-processor
Extends the CSS language
Provides variables, functions (lighten, darken, saturate, contrast) and mixins
http://lesscss.org/
@myBackgroundColor: #ffa242;
@myLightTextColor: #ffffff;
@myDarkTextColor: #000000;
.box {
color: contrast(@myBackgroundColor,@myLightTextColor,@myDarkTextColor);
background-color: @myBackgroundColor;
border: 3px solid darken(@myBackgroundColor, 30%);
}
6
Less.js
Open Source CSS pre-processor
Extends the CSS language
Provides variables, functions (lighten, darken, saturate, contrast) and mixins
http://lesscss.org/
@myBackgroundColor: #e62d2d;
@myLightTextColor: #ffffff;
@myDarkTextColor: #000000;
.box {
color: contrast(@myBackgroundColor,@myLightTextColor,@myDarkTextColor);
background-color: @myBackgroundColor;
border: 3px solid darken(@myBackgroundColor, 30%);
}
Theme Structure & Inheritance
8
Base theme
Making Controls work properly
Contains basic styles
display, position, z-index,
overflow, box-sizing
Provides styles for all
themes
Not intended to be
actually used
Contains color / size
styles
By using semantic
parameters
9
Specific theme
Making Controls look properly
Contains theme specific
styles
background, gradient,
shadow, border-radius
Contains specific color /
size styles
By using semantic
parameters
Inherits from the base
theme
10
Theme Inheritance
@sapSelectedColor: #2e9cea
@sapSelectedColor: #e8eff6
overrides
sap_belize
base
imports
Theme Parameters
12
Theme Parameters
One parameter affects multiple others
13
Custom Themes
15
Creating a custom theme
Inherit from sap_belize
16
Creating a custom theme
Override some parameters
@sapBaseColor: #161413;
Inherit from sap_belize
17
Creating a custom theme
Override some parameters
@sapBaseColor: #161413;
@sapList_Background: @sapBaseColor;
@sapField_Background: @sapBaseColor;
@sapBackgroundColor: @sapBaseColor;
Inherit from sap_belize
18
Creating a custom theme
Override some parameters
@sapBaseColor: #161413;
@sapList_Background: @sapBaseColor;
@sapField_Background: @sapBaseColor;
@sapBackgroundColor: @sapBaseColor;
@sapBrandColor: #e62d2d;
Inherit from sap_belize
19
Creating a custom theme
Override some parameters
@sapBaseColor: #161413;
@sapList_Background: @sapBaseColor;
@sapField_Background: @sapBaseColor;
@sapBackgroundColor: @sapBaseColor;
@sapBrandColor: #e62d2d;
@sapTextColor: #ffa242;
@sapField_TextColor: #fff;
@sapNeutralColor: #fff;
Inherit from sap_belize
20
Creating a custom theme
Override some parameters
@sapBaseColor: #161413;
@sapList_Background: @sapBaseColor;
@sapField_Background: @sapBaseColor;
@sapBackgroundColor: @sapBaseColor;
@sapBrandColor: #e62d2d;
@sapTextColor: #ffa242;
@sapField_TextColor: #fff;
@sapNeutralColor: #fff;
@sapSelectedColor: rgba(255,162,66,.2);
@sapList_SelectionBackgroundColor: @sapSelectedColor;
Inherit from sap_belize
21
Creating a custom theme
Override some parameters
@sapBaseColor: #161413;
@sapList_Background: @sapBaseColor;
@sapField_Background: @sapBaseColor;
@sapBackgroundColor: @sapBaseColor;
@sapBrandColor: #e62d2d;
@sapTextColor: #ffa242;
@sapField_TextColor: #fff;
@sapNeutralColor: #fff;
@sapSelectedColor: rgba(255,162,66,.2);
@sapList_SelectionBackgroundColor: @sapSelectedColor;
@sapList_HeaderBackground: @sapGroup_ContentBackground;
@sapPageFooter_Background: @sapGroup_ContentBackground;
Inherit from sap_belize
22
Creating a custom theme
Project repository:
https://github.com/matz3/ui5con17-custom-theme
Technical Details
Built with Node.js based OpenUI5 tools
Further Resources
24
SAP UI Theme Designer
WYSIWYG Editor for Themes
25
SAP UI Theme Designer
WYSIWYG Editor for Themes
26
Theme Parameter Toolbox App
Find the right theme parameters for control development
Thank you.
Contact information:
Matthias Oßwald, SAP
@matthiaso
Links
UI5con Custom Theme Project:
https://github.com/matz3/ui5con17-custom-theme
SAP UI Theme Designer:
https://wiki.scn.sap.com/wiki/display/UITD/UI+Theme+Designer+Home
Theme Parameter Toolbox App:
https://blogs.sap.com/2017/05/24/ui5ers-buzz-07-less-effort-find-your-less-theme-parameters/
https://openui5nightly.hana.ondemand.com/test-resources/sap/m/demokit/theming/webapp/index.html
You are welcome to give feedback for this session
in the UI5con Event App

Mais conteúdo relacionado

Semelhante a UI5con@SAP 2017 - UI5 Theming Explained

Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Tahmina Khatoon
 
Doing More With Less
Doing More With LessDoing More With Less
Doing More With LessDavid Engel
 
Using SASS in the WordPress environment - Ran Bar Zik
Using SASS in the WordPress environment - Ran Bar ZikUsing SASS in the WordPress environment - Ran Bar Zik
Using SASS in the WordPress environment - Ran Bar ZikMiriam Schwab
 
Elegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassElegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassMediacurrent
 
Sitecore 10 XC SXA frontend development using the SXA Storefront Branded
Sitecore 10 XC SXA frontend development using the SXA Storefront BrandedSitecore 10 XC SXA frontend development using the SXA Storefront Branded
Sitecore 10 XC SXA frontend development using the SXA Storefront BrandedSerge van den Oever
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFxStefan Bauer
 
Jina bolton - Refactoring Web Interfaces
Jina bolton - Refactoring Web InterfacesJina bolton - Refactoring Web Interfaces
Jina bolton - Refactoring Web InterfacesDevConFu
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)Folio3 Software
 
Learn Sass and Compass quick
Learn Sass and Compass quickLearn Sass and Compass quick
Learn Sass and Compass quickBilly Shih
 
WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4David Bisset
 
@Agawish creating a stunning ui with oracle adf faces, using sass
@Agawish   creating a stunning ui with oracle adf faces, using sass@Agawish   creating a stunning ui with oracle adf faces, using sass
@Agawish creating a stunning ui with oracle adf faces, using sassAmr Gawish
 
Branding SharePoint from Prototype to Deployment - Workshop
Branding SharePoint from Prototype to Deployment - WorkshopBranding SharePoint from Prototype to Deployment - Workshop
Branding SharePoint from Prototype to Deployment - WorkshopEric Overfield
 
Advanced Front End Architecture in D8: Sass, Gulp, & Living Style Guides
Advanced Front End Architecture in D8: Sass, Gulp, & Living Style GuidesAdvanced Front End Architecture in D8: Sass, Gulp, & Living Style Guides
Advanced Front End Architecture in D8: Sass, Gulp, & Living Style GuidesAidan Foster
 
Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5
Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5
Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5Cengage Learning
 
Advanced Technology for Web Application Design
Advanced Technology for Web Application DesignAdvanced Technology for Web Application Design
Advanced Technology for Web Application DesignBryce Kerley
 

Semelhante a UI5con@SAP 2017 - UI5 Theming Explained (20)

Why less?
Why less?Why less?
Why less?
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)
 
Doing More With Less
Doing More With LessDoing More With Less
Doing More With Less
 
Using SASS in the WordPress environment - Ran Bar Zik
Using SASS in the WordPress environment - Ran Bar ZikUsing SASS in the WordPress environment - Ran Bar Zik
Using SASS in the WordPress environment - Ran Bar Zik
 
Elegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassElegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs Sass
 
Sitecore 10 XC SXA frontend development using the SXA Storefront Branded
Sitecore 10 XC SXA frontend development using the SXA Storefront BrandedSitecore 10 XC SXA frontend development using the SXA Storefront Branded
Sitecore 10 XC SXA frontend development using the SXA Storefront Branded
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFx
 
[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX
 
Jina bolton - Refactoring Web Interfaces
Jina bolton - Refactoring Web InterfacesJina bolton - Refactoring Web Interfaces
Jina bolton - Refactoring Web Interfaces
 
PostCss
PostCssPostCss
PostCss
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)
 
Learn Sass and Compass quick
Learn Sass and Compass quickLearn Sass and Compass quick
Learn Sass and Compass quick
 
Do more with {less}
Do more with {less}Do more with {less}
Do more with {less}
 
WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4
 
@Agawish creating a stunning ui with oracle adf faces, using sass
@Agawish   creating a stunning ui with oracle adf faces, using sass@Agawish   creating a stunning ui with oracle adf faces, using sass
@Agawish creating a stunning ui with oracle adf faces, using sass
 
Suman_Chakraborty
Suman_ChakrabortySuman_Chakraborty
Suman_Chakraborty
 
Branding SharePoint from Prototype to Deployment - Workshop
Branding SharePoint from Prototype to Deployment - WorkshopBranding SharePoint from Prototype to Deployment - Workshop
Branding SharePoint from Prototype to Deployment - Workshop
 
Advanced Front End Architecture in D8: Sass, Gulp, & Living Style Guides
Advanced Front End Architecture in D8: Sass, Gulp, & Living Style GuidesAdvanced Front End Architecture in D8: Sass, Gulp, & Living Style Guides
Advanced Front End Architecture in D8: Sass, Gulp, & Living Style Guides
 
Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5
Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5
Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5
 
Advanced Technology for Web Application Design
Advanced Technology for Web Application DesignAdvanced Technology for Web Application Design
Advanced Technology for Web Application Design
 

Último

Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Lisi Hocke
 
WSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)Roberto Bettazzoni
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2WSO2
 
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
WSO2CON 2024 - OSU & WSO2: A Decade Journey in Integration & Innovation
WSO2CON 2024 - OSU & WSO2: A Decade Journey in Integration & InnovationWSO2CON 2024 - OSU & WSO2: A Decade Journey in Integration & Innovation
WSO2CON 2024 - OSU & WSO2: A Decade Journey in Integration & InnovationWSO2
 
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConEffective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConNatan Silnitsky
 
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNeo4j
 
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 

Último (20)

Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
 
WSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital Businesses
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2
 
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid Environments
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2CON 2024 - OSU & WSO2: A Decade Journey in Integration & Innovation
WSO2CON 2024 - OSU & WSO2: A Decade Journey in Integration & InnovationWSO2CON 2024 - OSU & WSO2: A Decade Journey in Integration & Innovation
WSO2CON 2024 - OSU & WSO2: A Decade Journey in Integration & Innovation
 
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConEffective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeCon
 
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMs
 
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 

UI5con@SAP 2017 - UI5 Theming Explained

  • 1. Matthias Oßwald, SAP June 30, 2017 UI5 Theming Explained
  • 2. 2 UI5 Theming Explained Agenda Less.js Introduction Theme Structure & Inheritance Theme Parameters Custom Themes Further Resources
  • 4. 4 Less.js Open Source CSS pre-processor Extends the CSS language Provides variables, functions (lighten, darken, saturate, contrast) and mixins http://lesscss.org/
  • 5. 5 Less.js Open Source CSS pre-processor Extends the CSS language Provides variables, functions (lighten, darken, saturate, contrast) and mixins http://lesscss.org/ @myBackgroundColor: #ffa242; @myLightTextColor: #ffffff; @myDarkTextColor: #000000; .box { color: contrast(@myBackgroundColor,@myLightTextColor,@myDarkTextColor); background-color: @myBackgroundColor; border: 3px solid darken(@myBackgroundColor, 30%); }
  • 6. 6 Less.js Open Source CSS pre-processor Extends the CSS language Provides variables, functions (lighten, darken, saturate, contrast) and mixins http://lesscss.org/ @myBackgroundColor: #e62d2d; @myLightTextColor: #ffffff; @myDarkTextColor: #000000; .box { color: contrast(@myBackgroundColor,@myLightTextColor,@myDarkTextColor); background-color: @myBackgroundColor; border: 3px solid darken(@myBackgroundColor, 30%); }
  • 7. Theme Structure & Inheritance
  • 8. 8 Base theme Making Controls work properly Contains basic styles display, position, z-index, overflow, box-sizing Provides styles for all themes Not intended to be actually used Contains color / size styles By using semantic parameters
  • 9. 9 Specific theme Making Controls look properly Contains theme specific styles background, gradient, shadow, border-radius Contains specific color / size styles By using semantic parameters Inherits from the base theme
  • 10. 10 Theme Inheritance @sapSelectedColor: #2e9cea @sapSelectedColor: #e8eff6 overrides sap_belize base imports
  • 12. 12 Theme Parameters One parameter affects multiple others
  • 13. 13
  • 15. 15 Creating a custom theme Inherit from sap_belize
  • 16. 16 Creating a custom theme Override some parameters @sapBaseColor: #161413; Inherit from sap_belize
  • 17. 17 Creating a custom theme Override some parameters @sapBaseColor: #161413; @sapList_Background: @sapBaseColor; @sapField_Background: @sapBaseColor; @sapBackgroundColor: @sapBaseColor; Inherit from sap_belize
  • 18. 18 Creating a custom theme Override some parameters @sapBaseColor: #161413; @sapList_Background: @sapBaseColor; @sapField_Background: @sapBaseColor; @sapBackgroundColor: @sapBaseColor; @sapBrandColor: #e62d2d; Inherit from sap_belize
  • 19. 19 Creating a custom theme Override some parameters @sapBaseColor: #161413; @sapList_Background: @sapBaseColor; @sapField_Background: @sapBaseColor; @sapBackgroundColor: @sapBaseColor; @sapBrandColor: #e62d2d; @sapTextColor: #ffa242; @sapField_TextColor: #fff; @sapNeutralColor: #fff; Inherit from sap_belize
  • 20. 20 Creating a custom theme Override some parameters @sapBaseColor: #161413; @sapList_Background: @sapBaseColor; @sapField_Background: @sapBaseColor; @sapBackgroundColor: @sapBaseColor; @sapBrandColor: #e62d2d; @sapTextColor: #ffa242; @sapField_TextColor: #fff; @sapNeutralColor: #fff; @sapSelectedColor: rgba(255,162,66,.2); @sapList_SelectionBackgroundColor: @sapSelectedColor; Inherit from sap_belize
  • 21. 21 Creating a custom theme Override some parameters @sapBaseColor: #161413; @sapList_Background: @sapBaseColor; @sapField_Background: @sapBaseColor; @sapBackgroundColor: @sapBaseColor; @sapBrandColor: #e62d2d; @sapTextColor: #ffa242; @sapField_TextColor: #fff; @sapNeutralColor: #fff; @sapSelectedColor: rgba(255,162,66,.2); @sapList_SelectionBackgroundColor: @sapSelectedColor; @sapList_HeaderBackground: @sapGroup_ContentBackground; @sapPageFooter_Background: @sapGroup_ContentBackground; Inherit from sap_belize
  • 22. 22 Creating a custom theme Project repository: https://github.com/matz3/ui5con17-custom-theme Technical Details Built with Node.js based OpenUI5 tools
  • 24. 24 SAP UI Theme Designer WYSIWYG Editor for Themes
  • 25. 25 SAP UI Theme Designer WYSIWYG Editor for Themes
  • 26. 26 Theme Parameter Toolbox App Find the right theme parameters for control development
  • 27. Thank you. Contact information: Matthias Oßwald, SAP @matthiaso Links UI5con Custom Theme Project: https://github.com/matz3/ui5con17-custom-theme SAP UI Theme Designer: https://wiki.scn.sap.com/wiki/display/UITD/UI+Theme+Designer+Home Theme Parameter Toolbox App: https://blogs.sap.com/2017/05/24/ui5ers-buzz-07-less-effort-find-your-less-theme-parameters/ https://openui5nightly.hana.ondemand.com/test-resources/sap/m/demokit/theming/webapp/index.html You are welcome to give feedback for this session in the UI5con Event App