SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Breakpoint
Simple example - Sass 
$bp-small: 768px; 
body { 
color: #333; 
@include breakpoint(max-width $bp-small) { 
background-color: #efefef; 
} 
@include breakpoint($bp-small) { 
font-size: 120%; 
} 
}
Simple example - CSS 
body { 
color: #333; 
} 
@media (max-width: 768px) { 
body { 
background-color: #efefef; 
} 
} 
@media (min-width: 768px) { 
body { 
font-size: 120%; 
} 
}
... so what?
More complex queries 
$bp-sm-screen-and-phones: 'only screen' (max-width 760px), 
max-device-width 900px; 
.rwd-table { 
@include breakpoint($bp-sm-screen-and-phones) { 
/* responsive table styles */ 
} 
} 
Compiled: 
@media only screen and (max-width: 760px), 
(max-device-width: 900px) { 
.rwd-table { 
/* responsive table styles */ 
} 
}
Resolution queries - Sass 
$hidpi: min-resolution 1.5dppx; 
.sprite-icon { 
background-image: url('images/sprite.png'); 
@include breakpoint($hidpi) { 
background-image: url('images/sprite2x.png'); 
} 
}
Resolution queries - CSS 
.sprite-icon { 
background-image: url('images/sprite.png'); 
} 
@media (min-resolution: 143dpi), 
(-webkit-min-device-pixel-ratio: 1.48958), 
(min--moz-device-pixel-ratio: 1.48958) { 
.sprite-icon { 
background-image: url('images/sprite2x.png'); 
} 
}
Media query fallbacks 
$bp-small: 768px; 
body { 
color: #333; 
@include breakpoint(max-width $bp-small) { 
background-color: #efefef; 
} 
@include breakpoint($bp-small, 'no-query' '.no-mqs') { 
font-size: 120%; 
} 
}
Fallback class 
body { 
color: #333; 
} 
@media (max-width: 768px) { 
body { background-color: #efefef; } 
} 
@media (min-width: 768px) { 
body { font-size: 120%; } 
} 
.no-mqs body { 
font-size: 120%; 
}
Multiple-file fallbacks 
$bp-small: 768px; 
body { 
color: #333; 
@include breakpoint(max-width $bp-small) { 
background-color: #efefef; 
} 
@include breakpoint($bp-small, 'no-query' true) { 
font-size: 120%; 
} 
}
Multiple-file fallbacks 
Style.scss: 
// this sheet includes the queries 
$breakpoint-no-queries: false; 
@import 'mqs'; 
Style.css: 
body { 
color: #333; 
} 
@media (max-width: 768px) { 
body { background-color: #efefef;} 
} 
@media (min-width: 768px) { 
body { font-size: 120%; } 
} 
Oldie.scss: 
// this sheet excludes the queries 
$breakpoint-no-queries: true; 
@import 'mqs'; 
Oldie.css: 
body { 
color: #333; 
font-size: 120%; 
}
Now let's do something fun...
...with IE8 support (single file)
_variables.scss 
_mixins.scss 
_typography.scss 
... 
Mobile.scss 
$breakpoint-no-queries: true; 
$include-mobile-styles: true; 
$include-desktop-styles: false; 
@import //all the partials 
Desktop.scss 
$breakpoint-no-queries: true; 
$include-mobile-styles: false; 
$include-desktop-styles: true; 
@import //all the partials 
Responsive.scss 
$breakpoint-no-queries: false; 
$include-mobile-styles: true; 
$include-desktop-styles: '.no-mqs'; 
@import //all the partials
The Sass... 
$bp-small: 768px; 
body { 
color: #333; 
@include breakpoint(max-width $bp-small, 
'no-query' $include-mobile-styles) { 
background-color: #efefef; 
} 
@include breakpoint($bp-small, 
'no-query' $include-desktop-styles) { 
font-size: 120%; 
} 
}
Thanks! 
@RoboAndie

Weitere ähnliche Inhalte

Was ist angesagt?

Drupal Themes
Drupal ThemesDrupal Themes
Drupal Themesakosh
 
LESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageLESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageKatsunori Tanaka
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction SassZeeshan Ahmed
 
Introduction to MongoDB and Workshop
Introduction to MongoDB and WorkshopIntroduction to MongoDB and Workshop
Introduction to MongoDB and WorkshopAhmedabadJavaMeetup
 
CHI-YAPC-2009
CHI-YAPC-2009CHI-YAPC-2009
CHI-YAPC-2009jonswar
 

Was ist angesagt? (7)

Drupal Themes
Drupal ThemesDrupal Themes
Drupal Themes
 
LESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageLESS : The dynamic stylesheet language
LESS : The dynamic stylesheet language
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction Sass
 
5.managing hdfs
5.managing hdfs5.managing hdfs
5.managing hdfs
 
Everest
EverestEverest
Everest
 
Introduction to MongoDB and Workshop
Introduction to MongoDB and WorkshopIntroduction to MongoDB and Workshop
Introduction to MongoDB and Workshop
 
CHI-YAPC-2009
CHI-YAPC-2009CHI-YAPC-2009
CHI-YAPC-2009
 

Ähnlich wie Breakpoint

Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"bentleyhoke
 
Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid PrototypingEven Wu
 
CSS'in Gücü Adına
CSS'in Gücü AdınaCSS'in Gücü Adına
CSS'in Gücü AdınaAdem Ilter
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書拓樹 谷
 
Front-End Dev Tools
Front-End Dev ToolsFront-End Dev Tools
Front-End Dev ToolsNetguru
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. The University of Akron
 
Work and play with SASS & Compass
Work and play with SASS & CompassWork and play with SASS & Compass
Work and play with SASS & CompassAndreas Dantz
 
Responsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebResponsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebEduardo Shiota Yasuda
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentationMario Noble
 
Raleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass PresentationRaleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass PresentationDaniel Yuschick
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockMarco Pinheiro
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with SassRob Friesel
 
Using Sass - Building on CSS
Using Sass - Building on CSSUsing Sass - Building on CSS
Using Sass - Building on CSSSayanee Basu
 
CSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the BackendCSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the BackendFITC
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassClaudina Sarahe
 
CSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustCSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustKyle Adams
 

Ähnlich wie Breakpoint (20)

Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
 
Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid Prototyping
 
CSS'in Gücü Adına
CSS'in Gücü AdınaCSS'in Gücü Adına
CSS'in Gücü Adına
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書
 
Front-End Dev Tools
Front-End Dev ToolsFront-End Dev Tools
Front-End Dev Tools
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors.
 
Work and play with SASS & Compass
Work and play with SASS & CompassWork and play with SASS & Compass
Work and play with SASS & Compass
 
Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated Stylesheets
 
Responsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebResponsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da Web
 
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
 
Theming and Sass
Theming and SassTheming and Sass
Theming and Sass
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
CSS3
CSS3CSS3
CSS3
 
Raleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass PresentationRaleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass Presentation
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with Sass
 
Using Sass - Building on CSS
Using Sass - Building on CSSUsing Sass - Building on CSS
Using Sass - Building on CSS
 
CSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the BackendCSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the Backend
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
 
CSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustCSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie Dust
 

Mehr von Andrea Robertson

Meet your members' expectations
Meet your members' expectationsMeet your members' expectations
Meet your members' expectationsAndrea Robertson
 
Achieving Performance Improvement with iMIS Scoring Plus
Achieving Performance Improvement with iMIS Scoring PlusAchieving Performance Improvement with iMIS Scoring Plus
Achieving Performance Improvement with iMIS Scoring PlusAndrea Robertson
 
Things you may not know about iMIS
Things you may not know about iMISThings you may not know about iMIS
Things you may not know about iMISAndrea Robertson
 
Form & Function: Creating Email Templates
Form & Function: Creating Email TemplatesForm & Function: Creating Email Templates
Form & Function: Creating Email TemplatesAndrea Robertson
 
How to get the most out of Process Automation (iNNOVATIONS 2015)
How to get the most out of Process Automation (iNNOVATIONS 2015)How to get the most out of Process Automation (iNNOVATIONS 2015)
How to get the most out of Process Automation (iNNOVATIONS 2015)Andrea Robertson
 
What's New in RiSE for Mobile (iNNOVATIONS 2015)
What's New in RiSE for Mobile (iNNOVATIONS 2015)What's New in RiSE for Mobile (iNNOVATIONS 2015)
What's New in RiSE for Mobile (iNNOVATIONS 2015)Andrea Robertson
 
Responsive Web Design in iMIS (NiUG Austin 2015)
Responsive Web Design in iMIS (NiUG Austin 2015)Responsive Web Design in iMIS (NiUG Austin 2015)
Responsive Web Design in iMIS (NiUG Austin 2015)Andrea Robertson
 
Responsive Design in iMIS Part 2
Responsive Design in iMIS Part 2Responsive Design in iMIS Part 2
Responsive Design in iMIS Part 2Andrea Robertson
 
Crafting a visually appealing website with iMIS
Crafting a visually appealing website with iMISCrafting a visually appealing website with iMIS
Crafting a visually appealing website with iMISAndrea Robertson
 
Preserving the iMIS Upgrade Path
Preserving the iMIS Upgrade PathPreserving the iMIS Upgrade Path
Preserving the iMIS Upgrade PathAndrea Robertson
 

Mehr von Andrea Robertson (11)

Meet your members' expectations
Meet your members' expectationsMeet your members' expectations
Meet your members' expectations
 
Modern websites in RiSE
Modern websites in RiSEModern websites in RiSE
Modern websites in RiSE
 
Achieving Performance Improvement with iMIS Scoring Plus
Achieving Performance Improvement with iMIS Scoring PlusAchieving Performance Improvement with iMIS Scoring Plus
Achieving Performance Improvement with iMIS Scoring Plus
 
Things you may not know about iMIS
Things you may not know about iMISThings you may not know about iMIS
Things you may not know about iMIS
 
Form & Function: Creating Email Templates
Form & Function: Creating Email TemplatesForm & Function: Creating Email Templates
Form & Function: Creating Email Templates
 
How to get the most out of Process Automation (iNNOVATIONS 2015)
How to get the most out of Process Automation (iNNOVATIONS 2015)How to get the most out of Process Automation (iNNOVATIONS 2015)
How to get the most out of Process Automation (iNNOVATIONS 2015)
 
What's New in RiSE for Mobile (iNNOVATIONS 2015)
What's New in RiSE for Mobile (iNNOVATIONS 2015)What's New in RiSE for Mobile (iNNOVATIONS 2015)
What's New in RiSE for Mobile (iNNOVATIONS 2015)
 
Responsive Web Design in iMIS (NiUG Austin 2015)
Responsive Web Design in iMIS (NiUG Austin 2015)Responsive Web Design in iMIS (NiUG Austin 2015)
Responsive Web Design in iMIS (NiUG Austin 2015)
 
Responsive Design in iMIS Part 2
Responsive Design in iMIS Part 2Responsive Design in iMIS Part 2
Responsive Design in iMIS Part 2
 
Crafting a visually appealing website with iMIS
Crafting a visually appealing website with iMISCrafting a visually appealing website with iMIS
Crafting a visually appealing website with iMIS
 
Preserving the iMIS Upgrade Path
Preserving the iMIS Upgrade PathPreserving the iMIS Upgrade Path
Preserving the iMIS Upgrade Path
 

Kürzlich hochgeladen

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Kürzlich hochgeladen (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Breakpoint

  • 2. Simple example - Sass $bp-small: 768px; body { color: #333; @include breakpoint(max-width $bp-small) { background-color: #efefef; } @include breakpoint($bp-small) { font-size: 120%; } }
  • 3. Simple example - CSS body { color: #333; } @media (max-width: 768px) { body { background-color: #efefef; } } @media (min-width: 768px) { body { font-size: 120%; } }
  • 5. More complex queries $bp-sm-screen-and-phones: 'only screen' (max-width 760px), max-device-width 900px; .rwd-table { @include breakpoint($bp-sm-screen-and-phones) { /* responsive table styles */ } } Compiled: @media only screen and (max-width: 760px), (max-device-width: 900px) { .rwd-table { /* responsive table styles */ } }
  • 6. Resolution queries - Sass $hidpi: min-resolution 1.5dppx; .sprite-icon { background-image: url('images/sprite.png'); @include breakpoint($hidpi) { background-image: url('images/sprite2x.png'); } }
  • 7. Resolution queries - CSS .sprite-icon { background-image: url('images/sprite.png'); } @media (min-resolution: 143dpi), (-webkit-min-device-pixel-ratio: 1.48958), (min--moz-device-pixel-ratio: 1.48958) { .sprite-icon { background-image: url('images/sprite2x.png'); } }
  • 8.
  • 9. Media query fallbacks $bp-small: 768px; body { color: #333; @include breakpoint(max-width $bp-small) { background-color: #efefef; } @include breakpoint($bp-small, 'no-query' '.no-mqs') { font-size: 120%; } }
  • 10. Fallback class body { color: #333; } @media (max-width: 768px) { body { background-color: #efefef; } } @media (min-width: 768px) { body { font-size: 120%; } } .no-mqs body { font-size: 120%; }
  • 11. Multiple-file fallbacks $bp-small: 768px; body { color: #333; @include breakpoint(max-width $bp-small) { background-color: #efefef; } @include breakpoint($bp-small, 'no-query' true) { font-size: 120%; } }
  • 12. Multiple-file fallbacks Style.scss: // this sheet includes the queries $breakpoint-no-queries: false; @import 'mqs'; Style.css: body { color: #333; } @media (max-width: 768px) { body { background-color: #efefef;} } @media (min-width: 768px) { body { font-size: 120%; } } Oldie.scss: // this sheet excludes the queries $breakpoint-no-queries: true; @import 'mqs'; Oldie.css: body { color: #333; font-size: 120%; }
  • 13. Now let's do something fun...
  • 14.
  • 15.
  • 16. ...with IE8 support (single file)
  • 17. _variables.scss _mixins.scss _typography.scss ... Mobile.scss $breakpoint-no-queries: true; $include-mobile-styles: true; $include-desktop-styles: false; @import //all the partials Desktop.scss $breakpoint-no-queries: true; $include-mobile-styles: false; $include-desktop-styles: true; @import //all the partials Responsive.scss $breakpoint-no-queries: false; $include-mobile-styles: true; $include-desktop-styles: '.no-mqs'; @import //all the partials
  • 18. The Sass... $bp-small: 768px; body { color: #333; @include breakpoint(max-width $bp-small, 'no-query' $include-mobile-styles) { background-color: #efefef; } @include breakpoint($bp-small, 'no-query' $include-desktop-styles) { font-size: 120%; } }
  • 19.

Hinweis der Redaktion

  1. Delete??