The document discusses organizing CSS for maintainability and readability. It recommends dividing CSS into separate style sheets for different media types, rule types, or site sections. Within style sheets, related rules should be indented and grouped with comments. Declarations should be formatted consistently, either each on its own line or all on one line. Class and ID names should be meaningful. Informational comments can provide context. The goal is to structure CSS so it is easily understood by anyone viewing it.
In this one hour tutorial Simon Collison will demonstrate why convention, order and understanding are vital to web design and development teams. He'll give insights into how Erskine approach projects and will help attendees explore ways of creating and evolving their own "Ultimate Package".
Why conventions are essential for successful web projects. How Erskine approach HTML, CSS & JavaScript in their own projects. What to consider when developing your own "Ultimate Package".
This document provides an overview and lessons for a coding course on front end web development. It discusses HTML and CSS, including key tags and properties. Specific lessons are outlined that involve building sample websites and pages to practice skills like adding structure with tags, formatting text with CSS, and using boxes and layouts. The final section discusses mobile-first design and using responsive coding.
The document discusses the Yahoo User Interface (YUI) Cascading Style Sheets (CSS) framework. It provides an overview of the key YUI CSS files, including reset.css for normalizing HTML elements, fonts.css for font styling, and grids.css for page layouts. It also covers common CSS concepts like the cascade, floats, positioning, and table-less design implemented through CSS. The document encourages semantic class names, proper formatting and comments for maintainability, and recommends tools for CSS development.
Build a WordPress theme from HTML5 template @ TelerikMario Peshev
How to build a WordPress theme out of HTML5 template, integrate dynamic components such as menus, sidebars and comment areas and use widget blocks for static sliced content.
at Telerik Academy, 19 Jun 2012
Introduction to Responsive Web Design http://tinyurl.com/9ldo4c6
Includes a sample project built from scratch in Node.js using LESS available on Github
We are all familiar with the common interface development process which is:
* first, preparing an interface layout by a designer;
* then, making an HTML/CSS dummy;
* next, adding some JavaScript tricks with a help of JavaScript ninja;
* and, finally, having a server guy operating on templates and doing all the integration stuff.
Even while sometimes all these things are done by the same person, these are different roles and different project stages, and you switch from stage to stage to complete the development cycle.
When looking for performance gains, people often try to achieve that by changing the way the process is managed.
This presentation is about is a completely different approach which changes development from within. The goal is to convert a flat process with distinct stages into a continuous, uninterrupted development flow.
You can achieve this by decomposing a web interface into independent pieces (the so-called blocks), once and for all, and use them to build interfaces the same way bricks are used to build a house.
Thus, each of these interface components can be developed separately, which allows maintenance, refactoring and redesign to happen simultaneously on different interface parts, whenever necessary. You are not tied to a specific stage of project development anymore.
To make this happen, there are several principles you can follow:
1. Special project file structure, where files are stored the way the whole project can be built from components;
2. CSS guidelines that allow an interface piece to fit anywhere on any page without affecting other pieces;
3. In JavaScript, your functionality can be described in a highly semantic way usually unavailable with any other common approach.
All this magic is called BEM, which stands for Block, Element, and Modifier.
With my presentation, this technology will be revealed in greater detail, and magic explained bit by bit.
As CSS3 adds support for rich styling in standards-based web applications, style sheet markup can quickly get out of control! Many CSS effects today require repetitive rules to cover the proprietary browser CSS prefixes. LESS for CSS is an open source framework that makes modern CSS more manageable. With support for variables, mix-ins, nested CSS rules, and operations, LESS finally makes complex CSS easy to maintain. In this session, you will discover how LESS can be easily adopted in any ASP.NET project and learn about tools that make it easy to work with LESS in Visual Studio 2010.
This document provides an overview of Object Oriented CSS (OOCSS), HTML5, and web performance. It discusses what OOCSS is, how to implement it, and why it is useful. It also briefly covers some HTML5 forms and communication features. Finally, it examines how to improve website speed. The goal is to look at these topics and discuss elegant and lean CSS as opposed to "fat sack of crap" code.
The document discusses the BEM (Block, Element, Modifier) methodology for organizing CSS, HTML, and JavaScript code. It describes BEM as a system that defines three basic entities - Blocks, Elements, and Modifiers - to structure user interfaces and components. Blocks are standalone parts of the interface, Elements are integral parts of Blocks, and Modifiers define properties or states. The document provides examples and guidelines for using BEM, including naming conventions for CSS classes, benefits like improved reusability and specificity, and recommendations for file structure and build processes.
Drawing the Line with Browser Compatibilityjsmith92
This document discusses browser compatibility and strategies for supporting older browsers like Internet Explorer 6. It addresses common layout issues in IE6 like the double margin bug and float containers. It also provides techniques for conditional comments, CSS hacks, frameworks and tools. The document then covers new technologies like HTML5 video, geolocation, CSS3 features and strategies for mobile browsers.
This document provides instructions for creating a basic template in Joomla. It discusses the file structure of a basic Joomla template which includes folders for CSS, images, and template files. It then outlines 4 steps to create a template: designing the layout, adding HTML markup, writing CSS code, and "Joomlafying" the code to integrate Joomla functions. The goal is to provide a basic understanding of what is required to build a functional Joomla template.
Jake Smith gave a presentation on LESS, a dynamic CSS language that allows variables, mixins, nesting, and other features to make CSS more maintainable. LESS compiles to regular CSS and can be used with the LESS.js library in browsers or a LESS compiler. Some key features of LESS discussed include variables, imports, nesting rules, mixins, and namespacing. Gotchas with LESS include limitations with media queries and transitions.
This document discusses different approaches for using CSS in React applications. It begins by outlining some of the issues with plain CSS, including lack of encapsulation and global namespace pollution. It then examines different methodologies for organizing CSS, including OOCSS, BEM, and SUIT CSS. Next, it covers pre/post-processors like Sass, LESS, and PostCSS. The document dives into examples of implementing styles in React using inline styles, CSS modules, Radium, and Styled Components. For each approach, it highlights the syntax and notes advantages and limitations. Finally, it closes with a brief look at emerging technologies that may impact future CSS practices.
1. The document lists new features in HTML5 and CSS3 including drag and drop, local storage, geolocation, media queries, and cross-browser compatibility.
2. It compares features between desktop and mobile browsers such as iPad, and notes HTML5 can provide capabilities previously requiring plugins like drag and drop files and geolocation without Flash.
3. New HTML5 features like local storage, geolocation, and drag and drop are gaining popularity for building engaging web applications and improving the user experience on various platforms.
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...Jer Clarke
Slides for a talk at the ConFoo 2012 conference in Montreal. I explain a simple yet powerful CSS architecture that avoids duplication and increases design consistency by grouping shared properties together rather than redefining them over and over. In the process I explain preprocessors like LESS and SASS, as well as the OOCSS fad, pointing out how they are insufficiently standards-compliant.
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011Patrick Lauke
The document discusses the new features of HTML5 including improved semantics, forms, and multimedia capabilities. Some key points:
1. HTML5 adds new semantic elements like <header>, <footer>, <nav> that more accurately describe content. It also simplifies the doctype to <!DOCTYPE html>.
2. HTML5 introduces richer built-in form controls without JavaScript like date/time pickers, number sliders, and improved validation.
3. Multimedia is enhanced with <video>, <audio>, and <canvas> elements, allowing native playback of audio/video without plugins and scriptable drawing on <canvas>.
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterDoris Chen
How to tackle real-world web platform performance problems in modern websites and apps? This session starts with a basic understanding of the web platform and then explores to a set of problem/solution pairs built from industry-standard performance guidance. In the talk, we will demonstrate performance tips and tricks that will help you improve the performance of your apps and sites today. We will discuss the following respond to network requests, speed and responsiveness, optimizing media usage, and writing fast JavaScript. These performance tips and tricks apply equally to web sites that run on standards based web browsers, as well as to modern apps.
From PSD to WordPress Theme: Bringing designs to lifeDerek Christensen
This document discusses bringing designs created in Photoshop or other design programs to life as WordPress themes. It covers considerations when slicing designs, using starter themes, building child themes, and inserting CSS. Tips are provided on focusing on high impact elements first, understanding the parent theme structure, and using tools like Firebug to debug designs. Resources for learning more about web development and WordPress theme building are also listed.
This document provides an overview of CSS (Cascading Style Sheets) including its history, basic syntax and structure, common properties that can be styled, and different methods for applying styles. Key points covered include using CSS to style fonts, colors, links, and page layout with properties like padding, margin, and floats. The document also demonstrates how to select elements with IDs, classes, and other selectors to style them.
In Drupal 7, I used contrib base themes like Bootstrap, Omega, or Zen as a starting point for most of the themes I created. Primarily, themers use base themes to improve accessibility, get more semantic markup, make responsive websites, and save time.
The Drupal 8 theme system provides more accessible, semantic markup in core and is responsive out-of-the-box. It's the perfect time to try theming without a contrib base theme. If you're deciding how to structure your first Drupal 8 theme and which base theme to use, this is the talk for you. The talk will include:
Overview of Drupal 8 core themes
Tips for building a responsive theme from scratch
Adding a grid system
Responsive navigation
Structuring CSS or SASS
Stop reinventing the wheel: Build Responsive Websites Using Bootstrapfreshlybakedpixels
Web development has become increasingly complex, with the advent of smartphones, tablets, and multiple browsers with varying capabilities. Bootstrap makes the process faster by providing pre-written HTML, CSS, and Javascript that has been thoroughly tested and debugged. Learn how to get started with this framework, and build a responsive web page. Explore commonly used components such as buttons, tabs, tooltips, pop-ups, and third-party plugins. See examples of beautiful websites built on Bootstrap.
Presented on Oct 5, 2015 at HighEdWeb 2015, Milwaukee, WI
Grok Drupal (7) Theming - 2011 Feb updateLaura Scott
These are slides from my presentation at Drupal Design Camp Los Angeles, February 2011. Video with rather low resolution version of the slides (we inadvertently recorded my presentation notes screen rather than the projector screen) can be viewed on blip:
http://ladrupal.blip.tv/file/4731722/
The document is a slideshow presentation about CSS architecture techniques. It discusses object-oriented CSS (OOCSS), block element modifier (BEM), CSS preprocessor extensions of BEM, responsive design patterns, style guide generators, specificity graphs, critical path CSS extraction, and the potential of web components. The presentation emphasizes building modular, reusable CSS components and establishing consistent CSS methodologies and architectures.
The document provides an overview of how to use CSS3 in WordPress. It introduces the presenter and their goal to teach the audience at least one new thing. It then covers CSS/CSS3 basics, terminology, syntax, properties, specificity, inspecting CSS, new CSS3 modules like colors, gradients, border radius, and how to add CSS in WordPress through themes, plugins or inline styles. Resources for further learning CSS are also provided, followed by time for questions.
Introducción rápida a HTML5, repasando brevemente la historia de HTML, qué APIs se añaden a HTML5, y qué avances en HTML, CSS y JavaScript rodean a este estándar.
Good CSS troubleshooting skills are important to decrease your workload and help you work better with others. Tips for clean code and targeting, as well as solutions to modern browser bugs are covered.
Good CSS troubleshooting skills are important to decrease your workload and help you work better with others. Tips for clean code and targetting, as well as solutions to modern browser bugs are covered. Presented at Rich Web Experience 2011, Ft. Lauderdale, FL.
This document provides an overview of Object Oriented CSS (OOCSS), HTML5, and web performance. It discusses what OOCSS is, how to implement it, and why it is useful. It also briefly covers some HTML5 forms and communication features. Finally, it examines how to improve website speed. The goal is to look at these topics and discuss elegant and lean CSS as opposed to "fat sack of crap" code.
The document discusses the BEM (Block, Element, Modifier) methodology for organizing CSS, HTML, and JavaScript code. It describes BEM as a system that defines three basic entities - Blocks, Elements, and Modifiers - to structure user interfaces and components. Blocks are standalone parts of the interface, Elements are integral parts of Blocks, and Modifiers define properties or states. The document provides examples and guidelines for using BEM, including naming conventions for CSS classes, benefits like improved reusability and specificity, and recommendations for file structure and build processes.
Drawing the Line with Browser Compatibilityjsmith92
This document discusses browser compatibility and strategies for supporting older browsers like Internet Explorer 6. It addresses common layout issues in IE6 like the double margin bug and float containers. It also provides techniques for conditional comments, CSS hacks, frameworks and tools. The document then covers new technologies like HTML5 video, geolocation, CSS3 features and strategies for mobile browsers.
This document provides instructions for creating a basic template in Joomla. It discusses the file structure of a basic Joomla template which includes folders for CSS, images, and template files. It then outlines 4 steps to create a template: designing the layout, adding HTML markup, writing CSS code, and "Joomlafying" the code to integrate Joomla functions. The goal is to provide a basic understanding of what is required to build a functional Joomla template.
Jake Smith gave a presentation on LESS, a dynamic CSS language that allows variables, mixins, nesting, and other features to make CSS more maintainable. LESS compiles to regular CSS and can be used with the LESS.js library in browsers or a LESS compiler. Some key features of LESS discussed include variables, imports, nesting rules, mixins, and namespacing. Gotchas with LESS include limitations with media queries and transitions.
This document discusses different approaches for using CSS in React applications. It begins by outlining some of the issues with plain CSS, including lack of encapsulation and global namespace pollution. It then examines different methodologies for organizing CSS, including OOCSS, BEM, and SUIT CSS. Next, it covers pre/post-processors like Sass, LESS, and PostCSS. The document dives into examples of implementing styles in React using inline styles, CSS modules, Radium, and Styled Components. For each approach, it highlights the syntax and notes advantages and limitations. Finally, it closes with a brief look at emerging technologies that may impact future CSS practices.
1. The document lists new features in HTML5 and CSS3 including drag and drop, local storage, geolocation, media queries, and cross-browser compatibility.
2. It compares features between desktop and mobile browsers such as iPad, and notes HTML5 can provide capabilities previously requiring plugins like drag and drop files and geolocation without Flash.
3. New HTML5 features like local storage, geolocation, and drag and drop are gaining popularity for building engaging web applications and improving the user experience on various platforms.
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...Jer Clarke
Slides for a talk at the ConFoo 2012 conference in Montreal. I explain a simple yet powerful CSS architecture that avoids duplication and increases design consistency by grouping shared properties together rather than redefining them over and over. In the process I explain preprocessors like LESS and SASS, as well as the OOCSS fad, pointing out how they are insufficiently standards-compliant.
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011Patrick Lauke
The document discusses the new features of HTML5 including improved semantics, forms, and multimedia capabilities. Some key points:
1. HTML5 adds new semantic elements like <header>, <footer>, <nav> that more accurately describe content. It also simplifies the doctype to <!DOCTYPE html>.
2. HTML5 introduces richer built-in form controls without JavaScript like date/time pickers, number sliders, and improved validation.
3. Multimedia is enhanced with <video>, <audio>, and <canvas> elements, allowing native playback of audio/video without plugins and scriptable drawing on <canvas>.
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterDoris Chen
How to tackle real-world web platform performance problems in modern websites and apps? This session starts with a basic understanding of the web platform and then explores to a set of problem/solution pairs built from industry-standard performance guidance. In the talk, we will demonstrate performance tips and tricks that will help you improve the performance of your apps and sites today. We will discuss the following respond to network requests, speed and responsiveness, optimizing media usage, and writing fast JavaScript. These performance tips and tricks apply equally to web sites that run on standards based web browsers, as well as to modern apps.
From PSD to WordPress Theme: Bringing designs to lifeDerek Christensen
This document discusses bringing designs created in Photoshop or other design programs to life as WordPress themes. It covers considerations when slicing designs, using starter themes, building child themes, and inserting CSS. Tips are provided on focusing on high impact elements first, understanding the parent theme structure, and using tools like Firebug to debug designs. Resources for learning more about web development and WordPress theme building are also listed.
This document provides an overview of CSS (Cascading Style Sheets) including its history, basic syntax and structure, common properties that can be styled, and different methods for applying styles. Key points covered include using CSS to style fonts, colors, links, and page layout with properties like padding, margin, and floats. The document also demonstrates how to select elements with IDs, classes, and other selectors to style them.
In Drupal 7, I used contrib base themes like Bootstrap, Omega, or Zen as a starting point for most of the themes I created. Primarily, themers use base themes to improve accessibility, get more semantic markup, make responsive websites, and save time.
The Drupal 8 theme system provides more accessible, semantic markup in core and is responsive out-of-the-box. It's the perfect time to try theming without a contrib base theme. If you're deciding how to structure your first Drupal 8 theme and which base theme to use, this is the talk for you. The talk will include:
Overview of Drupal 8 core themes
Tips for building a responsive theme from scratch
Adding a grid system
Responsive navigation
Structuring CSS or SASS
Stop reinventing the wheel: Build Responsive Websites Using Bootstrapfreshlybakedpixels
Web development has become increasingly complex, with the advent of smartphones, tablets, and multiple browsers with varying capabilities. Bootstrap makes the process faster by providing pre-written HTML, CSS, and Javascript that has been thoroughly tested and debugged. Learn how to get started with this framework, and build a responsive web page. Explore commonly used components such as buttons, tabs, tooltips, pop-ups, and third-party plugins. See examples of beautiful websites built on Bootstrap.
Presented on Oct 5, 2015 at HighEdWeb 2015, Milwaukee, WI
Grok Drupal (7) Theming - 2011 Feb updateLaura Scott
These are slides from my presentation at Drupal Design Camp Los Angeles, February 2011. Video with rather low resolution version of the slides (we inadvertently recorded my presentation notes screen rather than the projector screen) can be viewed on blip:
http://ladrupal.blip.tv/file/4731722/
The document is a slideshow presentation about CSS architecture techniques. It discusses object-oriented CSS (OOCSS), block element modifier (BEM), CSS preprocessor extensions of BEM, responsive design patterns, style guide generators, specificity graphs, critical path CSS extraction, and the potential of web components. The presentation emphasizes building modular, reusable CSS components and establishing consistent CSS methodologies and architectures.
The document provides an overview of how to use CSS3 in WordPress. It introduces the presenter and their goal to teach the audience at least one new thing. It then covers CSS/CSS3 basics, terminology, syntax, properties, specificity, inspecting CSS, new CSS3 modules like colors, gradients, border radius, and how to add CSS in WordPress through themes, plugins or inline styles. Resources for further learning CSS are also provided, followed by time for questions.
Introducción rápida a HTML5, repasando brevemente la historia de HTML, qué APIs se añaden a HTML5, y qué avances en HTML, CSS y JavaScript rodean a este estándar.
Good CSS troubleshooting skills are important to decrease your workload and help you work better with others. Tips for clean code and targeting, as well as solutions to modern browser bugs are covered.
Good CSS troubleshooting skills are important to decrease your workload and help you work better with others. Tips for clean code and targetting, as well as solutions to modern browser bugs are covered. Presented at Rich Web Experience 2011, Ft. Lauderdale, FL.
http://natbat.net/2008/Sep/28/css-systems/ - A CSS System is a reusable set of content-oriented markup patterns and associated CSS created to express a site's individual design. It is the end result of a process that emphasizes up-front planning, loose coupling between CSS and markup, pre-empting browser bugs and overall robustness. It also incorporates a shared vocabulary for developers to communicate the intent of the code. This talk elaborates on this concept, and also describes a number of tricks I use to pre-empt maintainability issues.
Originally presented at BarCamp London 5 in Richmond on the 28th of September 2008.
Team stylesheets should be structured, consistent and easy to navigate. Variables, nesting and partials in SCSS allow for isolated, reusable code and prevent repetition. Front-end developers appreciate documentation on technologies, rules and file structure to work effectively as a team.
The document contains a presentation on CSS (Cascading Style Sheets) given by Herman. The presentation covers the basics of CSS including how it separates design from HTML, writing CSS selectors for tags, classes and IDs, basic styling properties, the box model, positioning, CSS frameworks, and standards used at Bina Nusantara University.
Good CSS troubleshooting skills are important to decrease your workload and help you work better with others. Tips for clean code and targetting, as well as solutions to modern browser bugs are covered.
Structuring your CSS for maintainability: rules and guile lines to write CSSSanjoy Kr. Paul
Structuring your CSS for maintainability: rules and guile lines to write CSS
As you start work on larger stylesheets and big projects with a team, you will discover that maintaining a huge CSS file can be challenging. So, we will go through some best practices for writing CSS that will help us to maintain the CSS project easily.
HTML Web Devlopment presentation css.pptraghavanp4
CSS is a style sheet language used to determine the formatting of HTML documents. It separates the presentation of HTML elements from the document's structure and semantics. The key benefits of CSS include separation of concerns, cascade of rules, specificity of selector types, and the ability to control layout, colors, fonts and other stylistic aspects of HTML documents. The document provides an overview of CSS fundamentals including the anatomy of style sheets, applying styles via selectors, shorthand properties, and specificity which determines which styles get applied based on an element's selector types and order of rules.
CSS is a style sheet language used to determine the formatting of HTML documents. It separates the presentation of HTML elements from the document's structure and semantics. The key benefits of CSS include separation of concerns, cascading style sheets, and selector-based rules. CSS fundamentals include the anatomy of style sheets with selectors, declarations, and properties. Specificity rules determine which styles take precedence when multiple selectors apply to an element.
CSS is a style sheet language used to determine the formatting of HTML documents. It separates the presentation of HTML elements from the document's structure and semantics. The key benefits of CSS include separation of concerns, cascade of rules, specificity of selector types, and the ability to control layout, colors, fonts and other stylistic aspects of HTML documents. The document provides an overview of CSS fundamentals including the anatomy of style sheets, how rules are applied based on selector types and specificity, and formatting techniques.
Don't be fooled, CSS3 isn't the future, it's the present, and is ripe for the pickin' and is ready to respond to display your sites in multiple devices right now.
CSS3 isn't the future, it's the present, and is ripe for the pickin' and is ready to respond to display your sites in multiple devices right now. Presented at Web 2.0 Expo New York 2011.
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
Here are the steps to build a basic horizontal navigation menu bar:
1. Create an unordered list <ul> with class="menu"
2. Add list items <li> for each menu item
3. Style the <ul> with display:inline-block and border-bottom
4. Style the <li> with display:inline-block, padding and hover effect
5. Add a class="current" to highlight the active page
6. Use a border-left on .current to create a left arrow
Let me know if any part needs more explanation! Building menus is a common task and these techniques will serve you well.
CSS (Cascading Style Sheets) allows separation of design and content on web pages. It was created in 1994 and has become the W3C standard for controlling visual presentation. Using CSS provides advantages like faster downloads, streamlined maintenance, global design control, and cost savings through reduced bandwidth and higher search engine rankings. CSS can be applied through inline styles, embedded style sheets, or external style sheets linked via HTML. Resources for learning more about CSS include various websites documenting its capabilities and best practices.
This document discusses how to write maintainable CSS through organizing CSS files according to a design language's components (e.g. layout, color), authoring semantic and portable CSS code using classes and IDs, and documenting CSS code and conventions either through inline comments or generated documentation from comment tags. It emphasizes organizing CSS files by concern rather than by site section, separating IE conditional code into separate files, using a system for declaration order and formatting for readability, and having an effective text editor for working with CSS code.
This document discusses accelerated CSS techniques using tools like CSS frameworks, JavaScript, and CSS preprocessors. It introduces concepts like nested rules, variables, mixins, extends, imports, and powerful functions in CSS preprocessors that allow generating complex CSS from simpler code. CSS frameworks like Blueprint and modules for CSS3 properties are demonstrated. Image sprites are also mentioned briefly.
This document provides an overview of creating simple and responsive CSS3 designs. It discusses:
- Using a flexible grid, flexible images, and media queries to make a design responsive.
- The four steps to get responsive: plan the design, crunch the numbers, determine breaking points, and add media queries.
- New CSS3 properties and selectors that allow for richer web experiences.
- Tips for cross-browser compatibility like leveraging source order, filtering styles, and using tools to handle vendor prefixes.
The document discusses responsive web design and some best practices. It notes that responsive design is more than just fluid grids, flexible images, and media queries - it also requires considering architecture, performance, font sizing, breakpoints, image optimization, and more. The document provides tips on using relative units like ems and rems for font sizing, organizing media queries, selecting classes, and testing responsive sites.
CSS (Cascading Style Sheets) allows separation of design and content of web pages. It was created in 1994 and has become the W3C standard for controlling visual presentation. CSS separates design elements like colors and fonts from the structural HTML markup. This separation allows designers to change the look without altering the content. CSS offers advantages like faster downloads, streamlined maintenance, global design control, and cost savings through reduced bandwidth and higher search engine rankings. Resources for learning more about CSS include w3.org, csszengarden.com, and webmonkey.wired.com.
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.
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.
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.
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 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.
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 (RWD Summit)Zoe Gillenwater
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.
CSS Lessons Learned the Hard Way (Generate Conf)Zoe Gillenwater
Zoe Mickley Gillenwater gave a talk at Generate Conference in London where she shared several mistakes she made while learning CSS flexbox and other techniques. These included misunderstanding how flex-basis works, incorrectly using CSS transforms like rotateX, and making assumptions about screen reader support that caused accessibility issues. She emphasized that vulnerability and sharing mistakes openly can help both oneself and others learn. Making mistakes is a natural part of the learning process, and perfection should not be expected or feared.
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.
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.
1. The document discusses the CSS Flexible Box Layout Module (flexbox) and how to implement it.
2. Flexbox allows items to be laid out flexibly on a page and makes it easier to create responsive page layouts without needing many media queries.
3. The document demonstrates how to use various flexbox properties like flex-direction, flex-wrap, justify-content, and order to create common layouts like navigation bars, forms, and grids.
This document discusses CSS layout techniques, including past, present, and future options. It covers problems with traditional table-based and float-based layouts, as well as new CSS3 specifications for flexible box layout, grid layout, multi-column layout, and regions. Key upcoming features discussed include new float values, containment of floats, wrapping of floats, grid layout definitions and placement of elements, and flexible box properties for automatic sizing of elements.
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.
2. What I do
Books Web
now Flexible Web Design: Freelance graphic
Creating Liquid and Elastic designer and web
Layouts with CSS developer
www.flexiblewebbook.com CSS consultant
Member of Adobe
soon Stunning CSS3: Task Force for WaSP
A Project-based Guide to
the Latest in CSS
www.stunningcss3.com
2
3. Why maintainability matters
These people need to be able to read,
understand, and easily change your CSS:
✔ you
✔ your teammates
✔ your successor
✔ your clients
3
5. Why efficiency matters
✔ users like fast-loading pages
✔ Google likes fast-loading pages
✔ clients like happy users and happy Google
5
6. Have your cake
and eat it too?
Photo by Mike Chaput-Branson, “ Chocolate Beet Cake,” www.flickr.com/photos/427/2508045734 6
7. Often, yes.
Photo by Rich Renomeron, “ All Gone,” www.flickr.com/photos/rrenomeron/3336008209 7
8. But sometimes
the two
don't mix.
Photo by Tétine, “ Vinaigrette #2 - Olive oil,” www.flickr.com/photos/83331954@N00/1374377040 8
9. Maintainable but inefficient
#widget { /* for Widget modules in main content area */
overflow: auto; /* for float containment */
width: 200px;
background: #ccc;
border: 1px solid #999;
}
#widget h2 {
color: #39C;
font-family: Georgia, "Times New Roman", Times, serif;
}
#widget li {
background: url(bullet1.png) no-repeat;
}
#widget li li {
background: url(bullet2.png) no-repeat;
}
9
10. Efficient but hard to maintain
#widget{overflow:auto;width:200px;background:#ccc;border:1
px solid #999}
#widget h2{color:#39C;font-family: Georgia,"Times New
Roman",Times,serif}
#widget li{background:url(bullet1.png) no-repeat}
#widget li li{background:url(bullet2.png) no-repeat}
10
14. 1
Organized
How you should divide up (or not)
your style sheets and the rules
within them to make it easier to
find and work with what you need.
14
16. Separating into multiple sheets
• Media types
• Rule types (layout.css, text.css, etc)
• Site sections (home.css, store.css, etc)
• IE hacks via conditional comments
• CSS3 browser-prefixed properties
16
17. Separating media types
Separate screen and print styles:
<link href="main.css" media="screen" rel="stylesheet"
type="text/css">
<link href="print.css" media="print" rel="stylesheet"
type="text/css">
Overlapped screen and print styles:
<link href="main.css" rel="stylesheet" type="text/css">
<link href="print.css" media="print" rel="stylesheet"
type="text/css">
17
18. Keeping media types together
body {
color:#333;
background-color:#ccc;
}
@media screen, projection {
body { background-image:url(background.png); }
}
@media print {
body { background-color: #fff; color:#000; }
}
• One less HTTP request
• Easier to remember non-screen styles
18
19. Separating by rule type or site
sections
• Pros:
+ Easy to know where to look for a style
+ Pick and choose which page gets which
CSS files
• Cons:
– Redundancy of styles between sheets
– Hard to know where to look for a style
– Extra HTTP requests
• Bottom line: depends on project
19
21. Separating IE hacks with
conditional comments
• Pros:
+ No invalid/confusing hacks in main sheet
+ Non-IE don't download kb they don't need
+ Easy to get rid of later when not needed (ha)
• Cons:
– Rules for single widget kept in two or more
places
– Extra HTTP requests
– Triggers IE 8 to wait for main sheet to load
completely before loading anything else
21
23. Separating CSS3 browser-
prefixed properties
Put sheet with prefixes first in HTML:
<link href="prefixes.css" rel="stylesheet" type="text/css">
<link href="main.css" rel="stylesheet" type="text/css">
In main style sheet:
#widget { transform: rotate(90deg); }
In prefixes.css:
#widget {
-moz-transform: rotate(90deg);
-o-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
}
23
24. Separating CSS3 browser-
prefixed properties
• Pros:
+ No invalid properties in main sheet
+ Easy to get rid of later when not needed
+ Clean code makes you feel warm and fuzzy
• Cons:
– Extra HTTP request
– Rules for single widget kept in two places
– Easy to forget prefixed properties are
subject to change
24
25. Zoe's rule of thumb regarding
organizing style sheets
• Unless working on a very large site, keep
everything together as much as possible
• Why:
+ Avoids errors
+ Less debugging and maintenance time
+ Avoids redundancies
+ More efficient
25
26. Organizing rules within a sheet
Use comments to group related rules
/* LAYOUT ------------------ */
#wrapper { ... }
#header { ... }
/* TEXT -------------------- */
h1, h2, h3, h4, h5, h6 { ... }
/* IMAGES ------------------ */
.chart { ... }
/* FORMS ------------------- */
label { ... }
/* ARTICLES ---------------- */
.pullquote { ... }
26
27. Finding rules within a sheet
Add table of contents to top of sheet
referring to commented sections
/* This sheet contains rules for: */
/* LAYOUT, TEXT, IMAGES, FORMS, ARTICLES */
Add special character as searching aid
/* =ARTICLES ---------------- */
.pullquote { ... }
27
28. 2
Readable
Understandable by humans just
looking at your CSS out of
context. Formatting rules to make
it easy to tell what does what.
28
29. Indent related rules
#widget {
overflow: auto;
width: 200px;
background: #ccc;
border: 1px solid #999;
}
#widget h2 {
color: #39C;
font-family: Georgia, "Times New Roman", Times, serif;
}
#widget li {
background: url(bullet1.png) no-repeat;
}
#widget li li {
background: url(bullet2.png) no-repeat;
}
29
30. Order of declarations in a rule
• Choose a system, document it, and stick
with it
• Options:
– Alphabetical
– Group related properties (eg: position, top,
left)
– Layout related properties first (eg: display,
then positioning, then box model, then text)
30
31. Formatting declarations
Each declaration on new line
#widget {
overflow: auto;
width: 200px;
background: #ccc;
}
Each declaration on same line
#widget { overflow:auto; width:200px; background:#ccc; }
31
33. Informational comments
• Meta info: author, creation date, etc.
• Key of color codes
• Explanations for confusing things
– Hacks
– CSS3 browser prefixes
– Non-intuitive properties/values
– Items in progress
33
34. CSS practices that aren't so
readable
• Sprites
– Bloated, non-intuitive CSS
– But efficient: avoids HTTP requests
– CSS3 can reduce need
• Frameworks
– Class names often don't make sense out of
context
– Whole team needs to be and stay familiar
with framework's conventions
– Make your own
34
35. 3
Streamlined
Achieve a particular look with as
little CSS as possible.
35
36. Consolidate properties
• Shorthand properties to group related
properties
• Resets to remove browser defaults in
one place instead of several
• Inheritance to set default values in one
place, then override only when needed
36
38. Consolidate rules
• Grouped selectors
• Classes instead of IDs
• Classes instead of styling generic-
elements based on their location
• Classes with reusably broad names
38
39. Classes instead of IDs
Bad:
#sidebar-news li { border-bottom: 1px dashed #ccc; }
#footer-news li { border-bottom: 1px dashed #ccc; }
#press-releases li { border-bottom: 1px dashed #ccc; }
Good:
.news li { border-bottom: 1px dashed #ccc; }
39
40. Classes instead of location-
based element styles
Bad:
#sidebar li { border-bottom: 1px dashed #ccc; }
Could end up looking like this:
#sidebar li { border-bottom: 1px dashed #ccc; }
#sidebar .twitter li { border-bottom: none; color: #3C9; }
#footer-news li { border-bottom: 1px dashed #ccc; }
Good:
.news li { border-bottom: 1px dashed #ccc; }
.twitter { color: #3C9; }
40
42. Remove unused rules using
Dust-Me Selectors
• www.sitepoint.com/dustmeselectors
• Firefox extension that analyzes your
page or entire site and creates report of
selectors that don't apply to anything
42
44. Reduce load times
• Reduce file size:
– Remove unnecessary characters
– Use Gzip compression
• Reduce HTTP requests:
– Combine multiple CSS files
– Use sprites
– Use CSS3
• Improve parallel downloading:
– Don't combine @import and link
• Improve CSS parsing speed:
– Use efficient selectors 44
45. Minify your CSS
• Remove unnecessary characters (white
space, comments) to reduce file size
• Only on live file, not working files
– Make changes to non-minified file
– Copy sheet, minify, upload
45
46. How to minify your CSS
• Manual as part of formatting practices
• Semi-automated web tools:
– www.codebeautifier.com
– www.csscompressor.com
– www.cssoptimiser.com
– www.cssdrive.com/index.php/main/
csscompressor
• Semi-automated command-line tools:
– http://yuilibrary.com/projects/yuicompressor
– http://csstidy.sourceforge.net
46
47. Minify your CSS (and more)
with the Minify script
• http://code.google.com/p/minify
• What it does:
– Removes unnecessary characters
– Combines multiple CSS or JavaScript files
– Serves CSS/JS with gzip compression and
optimal cache headers
• Automatic when you upload changed file
47
48. Gzip compression
• HTTP compression utility
• Can compress many file types on server
• Browsers decode compressed files
automatically on client-side
• Needs to be activated on your server
and your site
48
49. Efficient CSS3 techniques
• Reduce the need for images/JS/Flash:
– border-radius
– box-shadow
– text-shadow
– gradients
– transforms
• Reduce the need for separate mobile
style sheets, sites, or width/device
detection scripts using media queries
49
50. Don't use @import and link
• Details at www.stevesouders.com/blog/
2009/04/09/dont-use-import
• Causes style sheets to be loaded
sequentially instead of at same time
–@ import and link together in head blocks IE
– link with @import in it blocks all browsers
50
51. Efficient selectors
• Browsers read selectors right to left
• IDs fastest, then classes, tags, universal
– Fast: div ul #widget { ... }
– Slow: #widget li a { ... }
• Don't add tags to start of selectors
– Bad: div#header { ... }
• Avoid descendent selectors when
possible
– Bad: #footer p { font-size: 80% }
– Good: #footer { font-size: 80% }
51
52. Selectors aren't that important
• Don't sacrifice code quality and
maintainability
• Speed tests:
www.stevesouders.com/blog/2009/03/
10/performance-impact-of-css-selectors
52
53. Learn more
Download slides, get links:
www.zomigi.com/blog/maintainable-efficient-css/
Book:
www.stunningcss3.com
Zoe Mickley Gillenwater
@ zomigi
design@ zomigi.com
www.zomigi.com
53