SlideShare a Scribd company logo
1 of 61
Download to read offline
Условно
Условно



адаптивно
адаптивно
©
Артём
Поликарпов
Стили
Стили
header.css
navigation.css
search.css
content.css
gallery.css
sidebar.css
photo.css
form.css
button.css
slider.css
modal.css
footer.css
styles.css
—
—
—
—
—
—
—
—
—
—
—
—
—
5
@import
@import
@import
import
import
import
Стили
'header.css';
'navigation.css';
'search.css';
css from 'content.css';
css from 'gallery.css';
css from 'sidebar.css';
01.
02.
03.
01.
02.
03.
6
styles.css
Адаптивность
.header
tomato
min-width: 768px
plum
min-width: 1024px
wheat
Адаптивность от мобильных
{
color: ;
}
@media ( )
.header {
color: ;
}
}
@media ( )
.header {
color: ;
}
}
01.
02.
03.
04.
05.
06.
07.
08.
01.
02.
03.
04.
05.
9
.header
wheat
max-width: 768px
plum
max-width: 1024px
tomato
Адаптивность от десктопа
{
color: ;
}
@media ( )
.header {
color: ;
}
}
@media ( )
.header {
color: ;
}
}
01.
02.
03.
04.
05.
06.
07.
08.
01.
02.
03.
04.
05.
10
Подключение
styles.css
https://fonts.googleapis.com/
print.css
base.css
catalog.css
gallery.css
Подключение
<link rel="stylesheet" href=" ">
<link rel="stylesheet" href=" ">
<link rel="stylesheet" href=" " media="print">
<link rel="stylesheet" href=" ">
<link rel="stylesheet" href=" ">
<link rel="stylesheet" href=" ">
01.
02.
03.
01.
02.
03.
12
Перфоманс
Перфоманс
Браузер запросил страницу
Сначала грузится HTML
Бразуер находит стили
Потом грузится CSS
Нашлись другие стили?
Снова грузится CSS
Всё, можно рисовать
1.
2.
3.
4.
5.
6.
7.
14
Совсем
ничего
styles.css
https://fonts.googleapis.com/
Перфоманс
<link rel="stylesheet" href=" ">
<link rel="stylesheet" href=" ">
/* styles.css */
@import 'header.css';
@import 'content.css';
@import 'footer.css';
01.
02.
01.
02.
03.
04.
16
©
Артём
Поликарпов
По-другому
.footer__list
По-другому
{
margin: 0;
padding: 0;
list-style: none;
}
PostCSS Media Minmax
01.
02.
03.
04.
05.
20
@media (width < 736px)
По-другому
{
.footer__list {
display: grid;
row-gap: 16px;
grid-column: 3 / span 2;
grid-row: 1 / span 2;
}
}
01.
02.
03.
04.
05.
06.
07.
08.
21
@media (width >= 736px)
По-другому
{
.footer__list {
display: flex;
flex-wrap: wrap;
grid-row: 1 / auto;
margin-bottom: -8px;
}
}
01.
02.
03.
04.
05.
06.
07.
08.
22
(width < 736px)
23
(max-width: 735px)
24
(width >= 736px)
25
(min-width: 736px)
26
(736px <= width < 1008px)
27
(min-width: 736px) and
(max-width: 1007px)
28
А что если…
base.css
mobile.css
tablet.css
desktop.css
А что если…
<link rel="stylesheet" href=" ">
<link rel="stylesheet" href=" ">
<link rel="stylesheet" href=" ">
<link rel="stylesheet" href=" ">
…и внутри файлов сгруппировать подходящие @media ?
Всё будет точно так же 😭
01.
02.
03.
04.
30
base.css
mobile.css
tablet.css
desktop.css
А что если…
<link rel="stylesheet" href=" ">
<link rel="stylesheet" href=" "
media="(width < 768px)">
<link rel="stylesheet" href=" "
media="(768px <= width < 1024px)">
<link rel="stylesheet" href=" "
media="(width >= 1024px)">
01.
02.
03.
04.
05.
06.
07.
31
(width < 768px)
(768px <= width < 1024px)
(width >= 1024px)
А что если…
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="mobile.css"
media=" ">
<link rel="stylesheet" href="tablet.css"
media=" ">
<link rel="stylesheet" href="desktop.css"
media=" ">
01.
02.
03.
04.
05.
06.
07.
32
(max-width: 767px)
(min-width: 768px) and (max-width: 1023px)
(min-width: 1024px)
А что если…
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="mobile.css"
media=" ">
<link rel="stylesheet" href="tablet.css"
media=" ">
<link rel="stylesheet" href="desktop.css"
media=" ">
01.
02.
03.
04.
05.
06.
07.
33
©
Adam
Argyle
©
Adam
Argyle
Не работает (
Нет,работает!
Base.css,70 б
body {
background-position: 50% 0;
font-family: sans-serif;
}
01.
02.
03.
04.
40
tomato
data:image/png;base64,…
Mobile.css,5 Кб
body {
background-color: ;
background-image: url(' ');
background-size: 445px 280px;
}
01.
02.
03.
04.
05.
41
plum
data:image/png;base64,…
Tablet.css,62 Кб
body {
background-color: ;
background-image: url(' ');
background-size: 379px 280px;
}
01.
02.
03.
04.
05.
42
plum
data:image/png;base64,…
Desktop.css,241 Кб
body {
background-color: ;
background-image: url(' ');
background-size: 512px 280px;
}
01.
02.
03.
04.
05.
43
Mobile
(width < 768px)
(768px <= width < 1024px)
(width >= 1024px)
Как там?..
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="mobile.css"
media=" ">
<link rel="stylesheet" href="tablet.css"
media=" ">
<link rel="stylesheet" href="desktop.css"
media=" ">
01.
02.
03.
04.
05.
06.
07.
46
Tablet
Desktop
Предпочтения
retina.css
heavy.css
prefers-reduced-data: no-preference
animation.css
prefers-reduced-motion: no-preference
dark.css
prefers-color-scheme: dark
Предпочтения
<link rel="stylesheet" href=" "
media="(resolution >= 2dppx)">
<link rel="stylesheet" href=" "
media="( )">
<link rel="stylesheet" href=" "
media="( )">
<link rel="stylesheet" href=" "
media="( )">
01.
02.
03.
04.
05.
06.
07.
08.
55
Инструменты
Инструменты
PostCSS Media Minmax
PostCSS Extract Media Query
PostCSS Combine Media Query
Webpack Media Query Plugin
TODO
TODO
TODO
TODO
—
—
—
—
—
—
—
—
57
Спасибо!
Ссылки
Range Context
Media Queries Level 5
Build user-adaptive interfaces with preference MQ
—
—
—
59
@pepelsbey
sokr.me/cad

More Related Content

Similar to "Conditionally adaptive" Vadim Makeev

Creating Art with Codes - CSS3
Creating Art with Codes - CSS3Creating Art with Codes - CSS3
Creating Art with Codes - CSS3
Sayanee Basu
 
Lect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptxLect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptx
zainm7032
 
How to develop a CSS Framework
How to develop a CSS FrameworkHow to develop a CSS Framework
How to develop a CSS Framework
Olivier Besson
 
Илья Пухальский (EPAM Systems)
Илья Пухальский (EPAM Systems)Илья Пухальский (EPAM Systems)
Илья Пухальский (EPAM Systems)
Ontico
 
The specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktopThe specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktop
betabeers
 

Similar to "Conditionally adaptive" Vadim Makeev (20)

Responsive Design: Mehr als CSS
Responsive Design: Mehr als CSSResponsive Design: Mehr als CSS
Responsive Design: Mehr als CSS
 
Let's dig into the Omega Theme!
Let's dig into the Omega Theme!Let's dig into the Omega Theme!
Let's dig into the Omega Theme!
 
Creating Art with Codes - CSS3
Creating Art with Codes - CSS3Creating Art with Codes - CSS3
Creating Art with Codes - CSS3
 
Lect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptxLect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptx
 
Css framework
Css frameworkCss framework
Css framework
 
Css framework
Css frameworkCss framework
Css framework
 
How to develop a CSS Framework
How to develop a CSS FrameworkHow to develop a CSS Framework
How to develop a CSS Framework
 
Make your website 2 times faster
Make your website 2 times fasterMake your website 2 times faster
Make your website 2 times faster
 
Adaptive layouts - standards>next Manchester 23.03.2011
Adaptive layouts - standards>next Manchester 23.03.2011Adaptive layouts - standards>next Manchester 23.03.2011
Adaptive layouts - standards>next Manchester 23.03.2011
 
Илья Пухальский (EPAM Systems)
Илья Пухальский (EPAM Systems)Илья Пухальский (EPAM Systems)
Илья Пухальский (EPAM Systems)
 
CSS3
CSS3CSS3
CSS3
 
Responsive web design
Responsive web designResponsive web design
Responsive web design
 
Bootstrap과 UI-Bootstrap
Bootstrap과 UI-BootstrapBootstrap과 UI-Bootstrap
Bootstrap과 UI-Bootstrap
 
Introduction to Responsive Design v.2
Introduction to Responsive Design v.2Introduction to Responsive Design v.2
Introduction to Responsive Design v.2
 
[CSSDevConf] Adaptive Images in Responsive Web Design 2014
[CSSDevConf] Adaptive Images in Responsive Web Design 2014[CSSDevConf] Adaptive Images in Responsive Web Design 2014
[CSSDevConf] Adaptive Images in Responsive Web Design 2014
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucks
 
The specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktopThe specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktop
 
Intro to @viewport & other new Responsive Web Design CSS features
Intro to @viewport & other new Responsive Web Design CSS featuresIntro to @viewport & other new Responsive Web Design CSS features
Intro to @viewport & other new Responsive Web Design CSS features
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
Responsive content
Responsive contentResponsive content
Responsive content
 

More from Fwdays

More from Fwdays (20)

"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y..."How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
 
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro Spodarets"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro Spodarets
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Distributed graphs and microservices in Prom.ua", Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua", Maksym Kindritskyi
 
"Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl..."Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl...
 
"How Ukrainian IT specialist can go on vacation abroad without crossing the T...
"How Ukrainian IT specialist can go on vacation abroad without crossing the T..."How Ukrainian IT specialist can go on vacation abroad without crossing the T...
"How Ukrainian IT specialist can go on vacation abroad without crossing the T...
 
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ..."The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
"The Strength of Being Vulnerable: the experience from CIA, Tesla and Uber", ...
 
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu..."[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
"[QUICK TALK] Radical candor: how to achieve results faster thanks to a cultu...
 
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care..."[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
"[QUICK TALK] PDP Plan, the only one door to raise your salary and boost care...
 
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"..."4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
"4 horsemen of the apocalypse of working relationships (+ antidotes to them)"...
 
"Reconnecting with Purpose: Rediscovering Job Interest after Burnout", Anast...
"Reconnecting with Purpose: Rediscovering Job Interest after Burnout",  Anast..."Reconnecting with Purpose: Rediscovering Job Interest after Burnout",  Anast...
"Reconnecting with Purpose: Rediscovering Job Interest after Burnout", Anast...
 
"Mentoring 101: How to effectively invest experience in the success of others...
"Mentoring 101: How to effectively invest experience in the success of others..."Mentoring 101: How to effectively invest experience in the success of others...
"Mentoring 101: How to effectively invest experience in the success of others...
 
"Mission (im) possible: How to get an offer in 2024?", Oleksandra Myronova
"Mission (im) possible: How to get an offer in 2024?",  Oleksandra Myronova"Mission (im) possible: How to get an offer in 2024?",  Oleksandra Myronova
"Mission (im) possible: How to get an offer in 2024?", Oleksandra Myronova
 
"Why have we learned how to package products, but not how to 'package ourselv...
"Why have we learned how to package products, but not how to 'package ourselv..."Why have we learned how to package products, but not how to 'package ourselv...
"Why have we learned how to package products, but not how to 'package ourselv...
 
"How to tame the dragon, or leadership with imposter syndrome", Oleksandr Zin...
"How to tame the dragon, or leadership with imposter syndrome", Oleksandr Zin..."How to tame the dragon, or leadership with imposter syndrome", Oleksandr Zin...
"How to tame the dragon, or leadership with imposter syndrome", Oleksandr Zin...
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 

"Conditionally adaptive" Vadim Makeev