This document discusses using flexbox for responsive web design. It begins with an overview of problems with other layout methods like floats and tables. Flexbox solves many of these issues by allowing boxes to automatically grow and shrink, be proportionally sized, and be laid out in any direction. The document demonstrates several uses of flexbox properties like flex-direction, justify-content, align-items and order to create responsive navigation bars, stacked icons, equal height columns, and reordering content. It emphasizes using flexbox now for progressive enhancement and discusses techniques for providing non-flexbox fallbacks.
Enhancing Responsiveness With Flexbox (Smashing Conference)Zoe Gillenwater
View the demos and get links to related files at http://zomigi.com/blog/rwd-flexbox. In this presentation, I talked about how to actually put flexbox to use in the real world—today. I demonstrated a bunch of practical ideas for how to use flexbox as progressive enhancement to improve sizing, spacing, and order in responsive web design, while still ensuring non-supporting browsers get an acceptable fallback experience.
Enhancing Responsiveness With Flexbox (CSS Day)Zoe Gillenwater
View the demos and get links to related files at http://zomigi.com/blog/rwd-flexbox. In this presentation, I talked about how to actually put flexbox to use in the real world—today. I demonstrated a bunch of practical ideas for how to use flexbox as progressive enhancement to improve sizing, spacing, and order in responsive web design, while still ensuring non-supporting browsers get an acceptable fallback experience.
Responsive Flexbox Inspiration (Responsive Day Out)Zoe Gillenwater
I think the biggest obstacle to getting started with flexbox is not being able to picture how to use it, because you’re stuck thinking in terms of what was possible with floats and other old layout methods. It was the same when we switched from tables to CSS layout, and from fixed to fluid layout—you had to make a mental shift to start thinking in terms of the new possibilities and approaches to old problems.
Flexbox lets you do lots of things you haven’t been able to do before, and some things you could do before but now in a simpler way. Once you see what flexbox can do in the real world, you can start picturing how to use it in your own work to solve real RWD problems today. Flexbox can be tricky to wrap your head around at first, but once you’ve learned it, it’s an incredibly quick, cheap way for you to add more responsiveness to your components.
Enhancing Responsiveness with Flexbox (CSS Conf EU 2015)Zoe Gillenwater
Flexbox and responsive web design go great together, like peanut butter and jelly! Flexbox gives you more control over the things you care about in a responsive layout and lets you create much morecomplex and reliable layouts than you can with floats, table display, or inline-block. All with far less CSS.
In this talk, you’ll learn what flexbox features are particularly suited to responsive layouts and how you can harness them by applying flexbox as a progressive enhancement. We’ll look at examples of responsive page components and patterns that you can enhance further by layering flexbox on top of other layout methods, ensuring all users get a good experience.
With solidified syntax and great browser support, flexbox, the CSS layout module that can make your layouts more flexible and responsive with ease, is finally ready to be used in your real-world work. We’ll talk about the when, what, and how of using flexbox today: when it’s a great choice use flexbox (and when not to), what UI and UX problems it can help you solve, and how to add it to your layouts in a robust way that doesn’t harm non-supporting browsers or accessibility. You’ll learn a step-by-step process for deciding on and deploying flexbox, with lots of examples along the way of flexbox in the wild.
With solidified syntax and great browser support, flexbox, the CSS layout module that can make your layouts more flexible and responsive with ease, is finally ready to be used in your real-world work. We’ll talk about the when, what, and how of using flexbox today: when it’s a great choice use flexbox (and when not to), what UI and UX problems it can help you solve, and how to add it to your layouts in a robust way that doesn’t harm non-supporting browsers or accessibility. You’ll learn a step-by-step process for deciding on and deploying flexbox, with lots of examples along the way of flexbox in the wild.
Enhancing Responsiveness With Flexbox (Smashing Conference)Zoe Gillenwater
View the demos and get links to related files at http://zomigi.com/blog/rwd-flexbox. In this presentation, I talked about how to actually put flexbox to use in the real world—today. I demonstrated a bunch of practical ideas for how to use flexbox as progressive enhancement to improve sizing, spacing, and order in responsive web design, while still ensuring non-supporting browsers get an acceptable fallback experience.
Enhancing Responsiveness With Flexbox (CSS Day)Zoe Gillenwater
View the demos and get links to related files at http://zomigi.com/blog/rwd-flexbox. In this presentation, I talked about how to actually put flexbox to use in the real world—today. I demonstrated a bunch of practical ideas for how to use flexbox as progressive enhancement to improve sizing, spacing, and order in responsive web design, while still ensuring non-supporting browsers get an acceptable fallback experience.
Responsive Flexbox Inspiration (Responsive Day Out)Zoe Gillenwater
I think the biggest obstacle to getting started with flexbox is not being able to picture how to use it, because you’re stuck thinking in terms of what was possible with floats and other old layout methods. It was the same when we switched from tables to CSS layout, and from fixed to fluid layout—you had to make a mental shift to start thinking in terms of the new possibilities and approaches to old problems.
Flexbox lets you do lots of things you haven’t been able to do before, and some things you could do before but now in a simpler way. Once you see what flexbox can do in the real world, you can start picturing how to use it in your own work to solve real RWD problems today. Flexbox can be tricky to wrap your head around at first, but once you’ve learned it, it’s an incredibly quick, cheap way for you to add more responsiveness to your components.
Enhancing Responsiveness with Flexbox (CSS Conf EU 2015)Zoe Gillenwater
Flexbox and responsive web design go great together, like peanut butter and jelly! Flexbox gives you more control over the things you care about in a responsive layout and lets you create much morecomplex and reliable layouts than you can with floats, table display, or inline-block. All with far less CSS.
In this talk, you’ll learn what flexbox features are particularly suited to responsive layouts and how you can harness them by applying flexbox as a progressive enhancement. We’ll look at examples of responsive page components and patterns that you can enhance further by layering flexbox on top of other layout methods, ensuring all users get a good experience.
With solidified syntax and great browser support, flexbox, the CSS layout module that can make your layouts more flexible and responsive with ease, is finally ready to be used in your real-world work. We’ll talk about the when, what, and how of using flexbox today: when it’s a great choice use flexbox (and when not to), what UI and UX problems it can help you solve, and how to add it to your layouts in a robust way that doesn’t harm non-supporting browsers or accessibility. You’ll learn a step-by-step process for deciding on and deploying flexbox, with lots of examples along the way of flexbox in the wild.
With solidified syntax and great browser support, flexbox, the CSS layout module that can make your layouts more flexible and responsive with ease, is finally ready to be used in your real-world work. We’ll talk about the when, what, and how of using flexbox today: when it’s a great choice use flexbox (and when not to), what UI and UX problems it can help you solve, and how to add it to your layouts in a robust way that doesn’t harm non-supporting browsers or accessibility. You’ll learn a step-by-step process for deciding on and deploying flexbox, with lots of examples along the way of flexbox in the wild.
With solidified syntax and great browser support, flexbox, the CSS layout module that can make your layouts more flexible and responsive with ease, is finally ready to be used in your real-world work. We’ll talk about the when, what, and how of using flexbox today: when it’s a great choice use flexbox (and when not to), what UI and UX problems it can help you solve, and how to add it to your layouts in a robust way that doesn’t harm non-supporting browsers or accessibility. You’ll learn a step-by-step process for deciding on and deploying flexbox, with lots of examples along the way of flexbox in the wild.
With solidified syntax and great browser support, flexbox, the CSS layout module that can make your layouts more flexible and responsive with ease, is finally ready to be used in your real-world work. We’ll talk about the when, what, and how of using flexbox today: when it’s a great choice use flexbox (and when not to), what UI and UX problems it can help you solve, and how to add it to your layouts in a robust way that doesn’t harm non-supporting browsers or accessibility. You’ll learn a step-by-step process for deciding on and deploying flexbox, with lots of examples along the way of flexbox in the wild.
Web developers have been trying to solve layout issues since the dawn of web. We started with tables, then floats and grids—each technique had its limitations. Thanks to Flexbox, it’s all about to change.
Flexbox is one of the most promising yet underutilized additions to the CSS3 specification. Using this layout model you can arrange elements in any direction, align them, distribute the space, assign sizes, stretch or shrink them to fit in parent element, wrap or rearrange them—all with far less CSS compared to grids.
Flexbox truly shines when used in responsive design. Changing the visual order, alignment, assigning proportional sizes of your boxes becomes a breeze. In this presentation, learn the basics of Flexbox specification and explore some of its practical uses.
Putting Flexbox into Practice presentation for Fronteers conference, October 10, 2013. Slightly updated version of slides posted in September. Get links to the demo page and related resources at http://www.zomigi.com/blog/flexbox-presentation.
The Flexbox (or Flexible Box) Layout Model is a set of CSS attributes allowing for the efficient creation of robust, multi-screen application layouts. Flexbox uses a dual-axis container/item layout model allowing for powerful approaches to element space distribution, alignment, and sizing. This can be a tremendous boon for web projects with dynamic data and design flux. It may also tremendously simplify responsive layouts that are dependent on commonly complicated grid models.
This presentation will introduce the mechanics of the Flexible Box Model and demonstrate its capability for simplifying markup and styling.
Putting Flexbox into Practice presentation for Blend Conference in Charlotte, September 7, 2013. Slightly updated version presented at Fronteers on October 10; slides at http://www.slideshare.net/zomigi/putting-flexbox-into-practice-fronteers. Get links to the demo page and related resources at http://www.zomigi.com/blog/flexbox-presentation.
Flex stands for flexibility, adaptability. Thus, flexible layout elements are flexible boxes. The ability to fill extra areas without using javascript is one of the key advantages of flexbox.
Flexbox is a smart new layout mode for CSS that solves many problems we've struggled with for years. It adds a degree of control we didn't have before. No longer will you need to struggle with floats and clearfixes to address page layout challenges they were never designed to handle.
But wait, I hear you say, a new layout mode? Surely the browser support is awful? It's actually quite good, and I will show you how to write future-proof code that will work flawlessly in browsers that support flexbox while providing a fallback to those that don't.
In this talk, I will introduce the flexbox layout module and explain what it's good for (and what's it's NOT good for). I'll give examples of usage, outline a strategy for browser support, and prepare you to use flexbox TODAY!
This is a beginner level talk. You do not need to know anything about flexbox, but a basic understanding of CSS layout will be helpful.
While the CSS Flexible Box Layout Module (Flexbox) has gone through some radical changes over the past two years, the specification is now stable enough for designers and developers to give it a hard look. Find out what Flexbox can (and can't) do to save your layout woes and how to integrate into your projects!
There was a time in the not so distant future, that tables ruled the field of HTML page development. Kika Marketing and Communications is here to give you an idea about Flexbox.
This complete guide explains everything about flexbox, focusing on all the different possible properties for the parent element (the flex container) and the child elements (the flex items).
You have some basic knowledge of HTML and CSS? Go further by learning how to build advanced layouts of real-life apps like Airbnb, Medium or Slack using the most recent CSS techniques.
With solidified syntax and great browser support, flexbox, the CSS layout module that can make your layouts more flexible and responsive with ease, is finally ready to be used in your real-world work. We’ll talk about the when, what, and how of using flexbox today: when it’s a great choice use flexbox (and when not to), what UI and UX problems it can help you solve, and how to add it to your layouts in a robust way that doesn’t harm non-supporting browsers or accessibility. You’ll learn a step-by-step process for deciding on and deploying flexbox, with lots of examples along the way of flexbox in the wild.
With solidified syntax and great browser support, flexbox, the CSS layout module that can make your layouts more flexible and responsive with ease, is finally ready to be used in your real-world work. We’ll talk about the when, what, and how of using flexbox today: when it’s a great choice use flexbox (and when not to), what UI and UX problems it can help you solve, and how to add it to your layouts in a robust way that doesn’t harm non-supporting browsers or accessibility. You’ll learn a step-by-step process for deciding on and deploying flexbox, with lots of examples along the way of flexbox in the wild.
Web developers have been trying to solve layout issues since the dawn of web. We started with tables, then floats and grids—each technique had its limitations. Thanks to Flexbox, it’s all about to change.
Flexbox is one of the most promising yet underutilized additions to the CSS3 specification. Using this layout model you can arrange elements in any direction, align them, distribute the space, assign sizes, stretch or shrink them to fit in parent element, wrap or rearrange them—all with far less CSS compared to grids.
Flexbox truly shines when used in responsive design. Changing the visual order, alignment, assigning proportional sizes of your boxes becomes a breeze. In this presentation, learn the basics of Flexbox specification and explore some of its practical uses.
Putting Flexbox into Practice presentation for Fronteers conference, October 10, 2013. Slightly updated version of slides posted in September. Get links to the demo page and related resources at http://www.zomigi.com/blog/flexbox-presentation.
The Flexbox (or Flexible Box) Layout Model is a set of CSS attributes allowing for the efficient creation of robust, multi-screen application layouts. Flexbox uses a dual-axis container/item layout model allowing for powerful approaches to element space distribution, alignment, and sizing. This can be a tremendous boon for web projects with dynamic data and design flux. It may also tremendously simplify responsive layouts that are dependent on commonly complicated grid models.
This presentation will introduce the mechanics of the Flexible Box Model and demonstrate its capability for simplifying markup and styling.
Putting Flexbox into Practice presentation for Blend Conference in Charlotte, September 7, 2013. Slightly updated version presented at Fronteers on October 10; slides at http://www.slideshare.net/zomigi/putting-flexbox-into-practice-fronteers. Get links to the demo page and related resources at http://www.zomigi.com/blog/flexbox-presentation.
Flex stands for flexibility, adaptability. Thus, flexible layout elements are flexible boxes. The ability to fill extra areas without using javascript is one of the key advantages of flexbox.
Flexbox is a smart new layout mode for CSS that solves many problems we've struggled with for years. It adds a degree of control we didn't have before. No longer will you need to struggle with floats and clearfixes to address page layout challenges they were never designed to handle.
But wait, I hear you say, a new layout mode? Surely the browser support is awful? It's actually quite good, and I will show you how to write future-proof code that will work flawlessly in browsers that support flexbox while providing a fallback to those that don't.
In this talk, I will introduce the flexbox layout module and explain what it's good for (and what's it's NOT good for). I'll give examples of usage, outline a strategy for browser support, and prepare you to use flexbox TODAY!
This is a beginner level talk. You do not need to know anything about flexbox, but a basic understanding of CSS layout will be helpful.
While the CSS Flexible Box Layout Module (Flexbox) has gone through some radical changes over the past two years, the specification is now stable enough for designers and developers to give it a hard look. Find out what Flexbox can (and can't) do to save your layout woes and how to integrate into your projects!
There was a time in the not so distant future, that tables ruled the field of HTML page development. Kika Marketing and Communications is here to give you an idea about Flexbox.
This complete guide explains everything about flexbox, focusing on all the different possible properties for the parent element (the flex container) and the child elements (the flex items).
You have some basic knowledge of HTML and CSS? Go further by learning how to build advanced layouts of real-life apps like Airbnb, Medium or Slack using the most recent CSS techniques.
Bi-Weekly Tech Talk for Woodridge Software Employees. Scott Holdeman explores the history, viability and implementation of the CSS3 flexbox (flexible box layout) layout in modern web browsers.
Similar to Enhancing Responsiveness with Flexbox (RWD Summit) (20)
Show vs. Tell in UX Design (Front in Amsterdam)Zoe Gillenwater
We’ve all heard these “laws” of design: “People don’t read on the web.” “If you have to explain how to use your product, you’ve failed.” “A picture is worth a thousand words.” It seems like our job as designers is to make things as intuitive as possible, using as few words as possible so that the meaning is self-evident through our visual design. But does this always produce the best user experience? Is showing always better than telling? We’ll look at several examples of design from the real world, the web, and apps that use showing, telling, or both as a method for producing the best UX. Rather than just assuming one is always better than the other, learn how to choose the right approach for your particular design problem and users.
Keynote presented at CSS Dev Conference on October 21, 2013. I talked about evolving who we are as web designers and developers by focusing on the power of "just one" in learning, failing, and accepting. Simplicity is powerful.
The updated CSS Dev Conference version of my Building Responsive Layouts talk. Get links to lots of related resources at http://zomigi.com/blog/responsive-layouts-css-dev-conf.
Get links to lots of related resources at http://zomigi.com/blog/responsive-layouts-presentation.
In this presentation, you'll learn about two of the core components of responsive web design: fluid/liquid layouts and media queries. I cover fluid and hybrid fixed-fluid layout techniques, tips, and tricks so that you can build robust, flexible layouts without pulling your hair out. I then walk through adding CSS3 media queries onto a fluid layout to make it fully responsive to a variety of screen sizes and devices. Even older versions of Internet Explorer get some love with solutions to help them deal with your shiny new responsive layouts.
Learn about the basics of web accessibility: what it is, who it affects, why it matters, and some of the fundamental things you ought to be doing in your pages to make them more accessible.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
5. I even wrote a
book about it
in 2008.
Then I got into CSS “liquid” layout5
6. Problems with float layout
Difficulty with containment
Wrapping/float drop
Difficulty with equal-height columns
No float:center
No vertical centering
Visual location somewhat tied to HTML
order
6
7. The alternatives have problems, too
Source-order
dependent
Whitespace in source
appears visually
Source-order
dependent
No wrapping
No IE 7 support
7
Issues with inline-block Issues with table-cell
8. Flexbox solves a lot of these issues
Make boxes automatically grow to fill
space or shrink to avoid overflow
Give boxes proportional measurements
Lay out boxes in any direction
Align boxes on any side
Place boxes out of order from HTML
8
16. Demo: horizontal navigation
1. Turn <ul> into flex container:
.list-nav {
display: flex;
flex-direction: row; /* default */
...
}
2. Children <li> become flex items laid out on
single horizontal line
16
25. Wide variation: two-piece main nav
1. Add media query for wide width:
@media (min-width:860px) {
}
2. Add link to Modernizr, because we’re going
to need to feed styles to only flexbox
browsers in this case
25
26. Add Modernizr as needed
Flexbox and fallback styles can often co-
exist, but sometimes need (or want) to
isolate them
Modernizr can add flexbox, no-flexbox,
and flexboxlegacy classes to do this
26
27. Wide variation: two-piece main nav
3. Move nav bar up to overlap logo’s line:
@media (min-width:860px) {
.flexbox .list-nav {
position: relative;
top: -70px;
}
}
27
28. Wide variation: two-piece main nav
4. Stop distributing links across full width:
@media (min-width:860px) {
.flexbox .list-nav {
justify-content: flex-start;
position: relative;
top: -70px;
}
}
28
29. Wide variation: two-piece main nav
5. Add margins to control extra space in line:
.flexbox .link-party {
margin-left: auto;
}
.flexbox .link-home { margin-right: 15px; }
.flexbox .link-tumblr { margin-left: 15px; }
29
39. Combining units of measurement across
a line can make RWD tricky.
ems + % + px = ?39
40. Demo: responsive form40
Inspired by http://jobs.theguardian.com/,
which uses floats and percentage widths
41. But it would be nicer if…41
The drop-down and button were sized
automatically by their content, so this
doesn’t happen:
The fields and button all matched each
other exactly in height
42. Enhance with flexbox42
1. Let the fields wrap when needed:
.jobs-form {
display: flex;
flex-wrap: wrap;
}
2. Fields become flex items with row
orientation, but are allowed to form multiple
rows (so it looks like 1 column when
narrow)
43. Enhance with flexbox43
3. Override the % widths and let fields size to
their content:
.flexbox .jobs-form_field-wrapper {
width: auto; /* hide from non-flex browsers */
flex: 1 1 100%;
}
@media (min-width:40em) {
.jobs-form_field-wrapper {
flex: 1 0 auto;
}
}
44. Defining the flex property
Makes flex items change their main size
(width or height) to fit available space
44
45. Defining the flex property
flex-grow
how much flex
item will grow
relative to
other items if
extra space is
available
(proportion
of extra space
that it gets)
flex-shrink
how much item
will shrink
relative to others
if there is not
enough space
(proportion of
overflow that
gets shaved off)
flex-basis
the initial
starting size
before free
space is
distributed
(any standard
width/height
value, including
auto)
45
46. Breaking it down
. jobs-form_field-wrapper {
flex: 1 0 auto;
}
flex-grow = 1
give each item 1
share of extra
width
flex-shrink = 0
don’t let items
shrink at all from
their starting width
flex-basis = auto
start items at “main
size” value (in this
case, width) or
content size if main
size not set
46
47. What flex-basis: auto will do47
Browser looks at main size value, width
width:auto, so field sizes to its content
Thus, content size=starting size/flex-basis
Wrapping= no reason to shrink lower than
starting size
flex-basis=min-width when wrapping on
Thus, content size=minimum field width
So, this can’t happen:
50. Enhance with flexbox50
5. Turn each field wrapper into flex container:
.flexbox .jobs-form_field-wrapper {
display: flex; /* sets align-items:stretch */
width: auto;
flex: 1 1 100%;
}
6. Input/button inside stretches to match
height of its line, thanks to default align-
items:stretch on flex containers, so all
fields are equal height on their line
56. Enhance with flexbox56
1. Make photo and text block automatically sit side-
by-side when they can fit (320px + 20em):
.article-header {
display: flex;
flex-wrap: wrap;
margin-left: -20px;
}
.article-header-image {
flex: 1 1 320px;
padding: 0 0 20px 20px;
}
.article-header-text {
flex: 1 1 20em;
padding: 0 0 20px 20px;
}
57. Enhance with flexbox57
2. Enhance alignment of text within the text block:
...
.article-header-text {
display: flex;
flex-wrap: wrap;
align-items: baseline;
align-content: space-between;
flex: 1 1 20em;
padding: 0 0 20px 20px;
}
.article-title {
flex: 1 1 100%;
}
.article-category {
flex: 1 1 auto;
}
63. Use order property to move logo
1. Divide nav bar into order groups:
.link-home, .link-builder {
order: 0; /* default, and first here */
}
.logo {
order: 1; /* second */
}
.link-party, .link-tumblr {
order: 2; /* last */
}
63
64. Use order property to move logo
2. Split extra space on line to center logo:
.logo {
margin-left: auto;
}
.link-party {
margin-left: auto;
}
64
65. Order only works on siblings65
To move logo to middle of list, it needs to be
part of list
<div class="logo"><img src="images/logo.png"></div>
<ul class="list-nav">
<li class="logo"><img src="images/logo.png"></li>
<li class="link-home"><a>home</a></li>
<li class="link-builder"><a>s'mores builder</a></li>
<li class="link-party"><a>throw a party</a></li>
<li class="link-tumblr"><a>tumblr</a></li>
</ul>
66. Accessibility implications
Pro
Can keep content in
logical order in HTML
instead of structuring
HTML just to achieve a
visual layout.
Cons
If HTML order is illogical,
screen reader users still
hear it.
Focus/tab order won’t
always match expected
order, may jump around
seemingly randomly.
66
67. If you’re using it for progressive
enhancement, the content should make
sense in both the HTML and visual order.
Use the order property sparingly67
68. Reordering mobile content
In RWD, narrow-view
(mobile) stacking order
doesn’t always match
needed HTML order for
wide-view (desktop)
layout
Keep HTML order needed
for desktop and use
order property only on
mobile, since browser
support is great there
Problem Solution
68
69. Jeremy Church’s mobile example
@media screen and (max-width: 767px) {
.media_xs_order_one { order: 0; }
.media_xs_order_two { order: 1; }
.media_xs_order_three { order: 2; }
}
See Jeremy’s write-up at http://j.eremy.net/flexbox-for-mobile-content/
HTML order (no flexbox) Reordered with flexbox
69
70. Be careful with accessibility
Reading order
won’t match
visual order. This
may or may not
be bad.
Tabbing order
won’t match
visual order. This
is bad. (And yes,
tabbing matters
even on mobile.)
1
3
2
4
5
70
71. Demo: moving a photo on mobile
Desktop: HTML order (no flexbox)Mobile: reordered
71
72. Use flexbox order in mobile styles
.recipe {
display: flex;
flex-direction: column;
}
.recipe figure {
order: -1; /* before all items with default
order: 0 */
}
.recipe figure img {
width: 100%;
}
Inspired by Jonathan Cutrell’s example at http://webdesign.tutsplus.com/
tutorials/tricks-with-flexbox-for-better-css-patterns--cms-19449
72
73. Turn off flexbox in desktop styles
@media screen and (min-width:800px) {
.recipe {
display: block; /* turn off flexbox */
}
.recipe figure {
float: right;
width: 55%;
}
}
73
74. Demo: moving a photo on mobile
Flexbox version Non-flexbox version
74
75. The Guardian: opposite approach75
Stacking order you
see when narrow
is the HTML order,
unchanged
1
2
3
4
5
6
76. The Guardian: opposite approach76
Reordered when
wide, but not
using order 12 3
4 56
flex-direction: row-reverse
flex-direction: row-reverse
79. I recommend you skip the ‘09 syntax79
It’s slower to render than current syntax*
Its browsers have tiny market share
You should be using flexbox in progressive
enhancement sort of way regardless, so its
browsers will just get same fallback you
provide to non-supporting browsers
* http://updates.html5rocks.com/2013/10/Flexbox-layout-isn-t-slow
80. Set up your tools
Let Autoprefixer, Sass, or LESS add the
browser variants for you:
https://github.com/ai/autoprefixer
https://github.com/mastastealth/sass-flex-mixin
https://gist.github.com/cimmanon/4461470
https://github.com/thoughtbot/bourbon/blob/mas
ter/app/assets/stylesheets/css3/_flex-box.scss
https://github.com/annebosman/FlexboxLess
Keep Modernizr on hand to help feed
different styles to different browsers:
http://modernizr.com/download/
80
84. Pick your starter/fallback layout CSS
Floats
table-cell
inline-block
Absolute positioning
84
Flexbox will override: Flexbox will not override:
No single right/best answer. Use whatever
you normally would.