SlideShare a Scribd company logo
1 of 84
Download to read offline
Architecting with
Style with Tim Knight
Hi!
I’m Tim Knight
Director User Experience @ GravityFree Studios
Organizer of the St. Petersburg Front-End Meetup
www.iamtimknight.com
This isn’t a talk about Joomla,
it’s a talk about designing things.
CSS gets a bad wrap because we rarely
spend the time understanding it the
way we should.
Looking at today
• Building grid systems by hand.
• When to use Flexbox vs. Layout Grid
• Using Sass mixins to abstract rules and complexities.
• Automating our duplication cleanup.
• When you should and shouldn’t use CSS Variables.
• Thinking about your design objects as isolated context-aware
components (spoiler… component queries!).
• If you aren’t already, start looking at your front-end design
systems as an evolving piece of software.
This won’t be a detailed talk about
each item. We’ll touch on some items
for each concept to get you thinking.
Where this all began
In a 15 year-old product begging for a redesign
• Based on a 960px 12-column grid
• Separate desktop and mobile sites
• jQuery and other ad-hoc plugins
• Product cards had various
undocumented visual states
• Layout inconsistencies
• Random accessibility issues
Building the grid
Forget Bootstrap and embrace your destiny
Bootstrap 3
Grid width of 1170px
Bootstrap 4
Grid width of 1140px
What? Why?
Our goal was to go bigger. We went
with a fluid grid that would max-out at
1440px wide.
Placing items on the grid is done using
their column and row numbers.
If you really need “offsets”
Using CSS Layout Grid is also about
taking you out of the mindset of feeling
like you need a full grid on everything.
CSS Layout Grid is a two-dimensional
grid. Meaning everything has a column
and row position. Unbalanced grids
can’t be centered—leave that to Flexbox.
Abstracting responsive
Using Sass loops & mixins to simplify design
The syntax for media queries was always
hard for my brain to remember.
This had the added benefit of
centralizing all my sizing in one place.
But accessing the data needed nuance.
Now we can generate column classes
HOLD UP
That seems like a lot of bullshit for CSS Layout Grid.
Cleaning up the mess
Using Gulp to kill repetition and process your Sass
Dropping media queries everywhere can
get really messy. But you can automate
your build process to clean that up.
Summing up what this gives us
• Automatically vendor prefixes our CSS, including the old
Microsoft CSS Grid prefixes.
• Source Maps for uncompressed versions.
• Compiled Sass
• Merged Media Queries
• Minified CSS
When to use variables
From Sass to CSS variables and back again
CSS Variables allow added flexibility
to set custom values that can be
scoped to a class or even changed
with JavaScript.
Why care?
Use CSS variables for…
• Values that can change during run time.
• Values that are changed based on JavaScript.
• Color schemes that use a specific set of colors.
Use Sass variables for…
• Values you want to be compiled into your CSS.
• Values you want to use Sass’ color functions with (e.g.
darken, lighten, etc.).
• Values used for conditional checking (like $debug: true;)
Directing your navigation
The power of Flexbox in the simplest of items
This isn’t just about navigation
Flexbox can really replace everything we
once used floats or display: inline for in
a way that’s more efficient to manage UI
items. Leave the layout stuff for Grid.
Use breakpoints to change direction
This puts us on the path for self-
contained components
Thinking in components
Design the page, but code the component
Let’s talk about the design process
Instead of programming the front-end
as a page, based on a design
composition, break your comp apart
into components and build a component
sheet to build all your pages.
This becomes your basis for
documentation and creates a way to
catch inconsistencies or issues in
your CSS specificity.
Dealing product cards
Context-aware and self-contained components
I’m a nerd for great card patterns
See Design Better Cards from Andrew Coyle
Flexbox and CSS Grid Layout provide great solutions for
things like column management and reflowing content.
However, there are often other considerations based on the
component’s placement you’ll want to make. Contrast,
hierarchy, or visual weight just to name a few.
Container/Element Queries solve this
problem. But they don’t actually exist.
See Element Queries for CSS by Tommy Hodgins
What might they look like?
Using eq.js
• A small JavaScript polyfill of 2KB
• Uses a data attribute on the component to define sizes
• Has a Sass mixin to make writing components even easier
Demos and code samples
https://github.com/timknight/container-queries-presentation/
Apply constant care
Pruning and organizing your code doesn’t end
Treat your front-end system as a living
document. Schedule code reviews and
continue to make small updates
throughout the life of it.
“The cowards never started and the weak died along the
way. That just leaves us, ladies and gentlemen. Us.”
— PHIL KNIGHT, NIKE
Questions?
Building a Blog
9
9.
Building a Blog
A lot of my clients started using a CMS because they wanted to start blogging. Of
course, many of them
stopped blogging within the next 90 days, but that’s beside the
point. Blogging is often a top requested feature for most CMSs and is often the reason
why solutions like WordPress are given a lot of priority. Even if you’re not building a
blog, you can use this same process for building news archives or other similar date-
sorted content for your website.
To do this, Craft CMS has a Section Type called a Channel. Unlike Structures which we
covered in the previous chapter, Channels are sorted by the publishing date which
makes them perfect for blogs or other news-based,date-sorted content on your site.
Creating the Section
First we’re going to into the Settings
>
Sections
and create a new section. To keep
things simple for now, we’ll just name this section “Blog” with a handle of “blog”.
Finally,just make sure that“Channel”is selected as your Section Type.
Building with Craft
74
Creating a Team Directory
!
If you want to edit the image file name or the image title. Just double check on the
image asset box.
!
Building with Craft
62
Designing Templates and Layouts with Twig
6
6.
Designing Templates and Layouts
with Twig
One of the most refreshing aspects of using Craft CMS is the use of the Twig templating
language. Of course there are ways to use Twig within other platforms like WordPress,
Drupal, and
even
your custom
PHP
projects, but having
Twig
built in
as a first-class
citizen in Craft without having to do any special configuration will help keep you from
losing your mind as you work on your projects.
Okay, first—let’s talk
about layouts. It’s common
to
find
a
project where
there
is a
separate header and
footer file that are included
within
all files. Twig
works a little
differently where you can “extend” a file from
your page and the effectively overwrite a
block of that extended
file’s content. This results in
giving you
a single file for both
your header and footer to act as your layout.
Let’s start putting
together a
layout to
see
how
this works in
practice. W
ithin
our
templates folder let’s create another folder called _layouts. I like to use an underscore
on files that aren’t directly accessed are that act as included or partial files.
W
ithin that folder we’re going to create a new
file called main.twig
which will act as our
main
layout. Craft CMS
supports
files
with
either the html
extension
or the twig
extension. I tend to prefer using the twig
extension so regardless of the text editor I’m
Building with Craft
30
Table of Contents
Preface
iii
...........................................................................................................
What is Craft CMS?
iv
...............................................................................................
Who Should Read This Book?
iv
...............................................................................
Legal
v
.......................................................................................................................
About the Author
vi
...........................................................................................
1. Power for Front-End Developers
1
..............................................................
Part I: Craft Fundamentals
2. Installing Craft CMS
3
...................................................................................
Downloading and Installing MAMP
4
........................................................................
Downloading Craft CMS
7
.........................................................................................
Connecting Craft to MySQL
11
.................................................................................
Finalizing Your Installation
15
....................................................................................
Deleting Admin Defaults
17
.......................................................................................
Selecting Your License
18
.........................................................................................
Managing Site Configuration
20
................................................................................
3. Setting Up Multiple Environment Support
21
.............................................
4. Organizing Site Assets
24
............................................................................
Adding Static Assets
24
............................................................................................
Creating an Asset Source for Uploads
24
.................................................................
5. Section Types, Entry Types, and Fields
28
..................................................
Defining a Section Type
28
........................................................................................
Single
28
..............................................................................................................
Channel
28
...........................................................................................................
Structure
28
..........................................................................................................
Creating New Fields
29
.............................................................................................
6. Designing Templates and Layouts with Twig
30
........................................
Extending Our Layout
33
...........................................................................................
Including Partials
35
..................................................................................................
Building with Craft
i
Get updates at
www.iamtimknight.com
I am writing
a book.
thank you.
Tim Knight
iamtimknight.com
Find this and other talks at
https://speakerdeck.com/timknight

More Related Content

What's hot

Accessibility Hacks version 2
Accessibility Hacks version 2Accessibility Hacks version 2
Accessibility Hacks version 2Graham Armfield
 
Designing in the Browser - Design for Drupal, Boston 2010
Designing in the Browser - Design for Drupal, Boston 2010Designing in the Browser - Design for Drupal, Boston 2010
Designing in the Browser - Design for Drupal, Boston 2010canarymason
 
The Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital CampThe Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital Campcanarymason
 
Building a Better Web with HTML5 and CSS3
Building a Better Web with HTML5 and CSS3Building a Better Web with HTML5 and CSS3
Building a Better Web with HTML5 and CSS3Karambir Singh Nain
 
Biml for Beginners: Speed up your SSIS development (SQLBits XV)
Biml for Beginners: Speed up your SSIS development (SQLBits XV)Biml for Beginners: Speed up your SSIS development (SQLBits XV)
Biml for Beginners: Speed up your SSIS development (SQLBits XV)Cathrine Wilhelmsen
 
Improving the Responsive Web Design Process in 2016
Improving the Responsive Web Design Process in 2016Improving the Responsive Web Design Process in 2016
Improving the Responsive Web Design Process in 2016Cristina Chumillas
 
Getting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundationGetting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundationMelanie Archer
 
Drupaldelphia Shortcuts Cheats And Cheap Stunts
Drupaldelphia  Shortcuts Cheats And Cheap StuntsDrupaldelphia  Shortcuts Cheats And Cheap Stunts
Drupaldelphia Shortcuts Cheats And Cheap Stuntscanarymason
 
Responsive Web Design for Universal Access 2016
Responsive Web Design for Universal Access 2016Responsive Web Design for Universal Access 2016
Responsive Web Design for Universal Access 2016Kate Walser
 
Stop reinventing the wheel: Build Responsive Websites Using Bootstrap
Stop reinventing the wheel: Build Responsive Websites Using BootstrapStop reinventing the wheel: Build Responsive Websites Using Bootstrap
Stop reinventing the wheel: Build Responsive Websites Using Bootstrapfreshlybakedpixels
 
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...Cathrine Wilhelmsen
 
Responsive web designing ppt(1)
Responsive web designing ppt(1)Responsive web designing ppt(1)
Responsive web designing ppt(1)admecindia1
 
Themer's roundtable
Themer's roundtableThemer's roundtable
Themer's roundtablecanarymason
 
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...Jer Clarke
 

What's hot (19)

Accessibility Hacks version 2
Accessibility Hacks version 2Accessibility Hacks version 2
Accessibility Hacks version 2
 
Learn Bootstrap 4
Learn Bootstrap 4Learn Bootstrap 4
Learn Bootstrap 4
 
Designing in the Browser - Design for Drupal, Boston 2010
Designing in the Browser - Design for Drupal, Boston 2010Designing in the Browser - Design for Drupal, Boston 2010
Designing in the Browser - Design for Drupal, Boston 2010
 
The Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital CampThe Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital Camp
 
Object Oriented CSS
Object Oriented CSSObject Oriented CSS
Object Oriented CSS
 
Building a Better Web with HTML5 and CSS3
Building a Better Web with HTML5 and CSS3Building a Better Web with HTML5 and CSS3
Building a Better Web with HTML5 and CSS3
 
Biml for Beginners: Speed up your SSIS development (SQLBits XV)
Biml for Beginners: Speed up your SSIS development (SQLBits XV)Biml for Beginners: Speed up your SSIS development (SQLBits XV)
Biml for Beginners: Speed up your SSIS development (SQLBits XV)
 
Improving the Responsive Web Design Process in 2016
Improving the Responsive Web Design Process in 2016Improving the Responsive Web Design Process in 2016
Improving the Responsive Web Design Process in 2016
 
Getting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundationGetting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundation
 
Drupaldelphia Shortcuts Cheats And Cheap Stunts
Drupaldelphia  Shortcuts Cheats And Cheap StuntsDrupaldelphia  Shortcuts Cheats And Cheap Stunts
Drupaldelphia Shortcuts Cheats And Cheap Stunts
 
Responsive Web Design for Universal Access 2016
Responsive Web Design for Universal Access 2016Responsive Web Design for Universal Access 2016
Responsive Web Design for Universal Access 2016
 
Slides bootstrap-4
Slides bootstrap-4Slides bootstrap-4
Slides bootstrap-4
 
Bootstrap 4 alpha 6
Bootstrap 4 alpha 6Bootstrap 4 alpha 6
Bootstrap 4 alpha 6
 
Stop reinventing the wheel: Build Responsive Websites Using Bootstrap
Stop reinventing the wheel: Build Responsive Websites Using BootstrapStop reinventing the wheel: Build Responsive Websites Using Bootstrap
Stop reinventing the wheel: Build Responsive Websites Using Bootstrap
 
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...
 
Responsive web designing ppt(1)
Responsive web designing ppt(1)Responsive web designing ppt(1)
Responsive web designing ppt(1)
 
Themer's roundtable
Themer's roundtableThemer's roundtable
Themer's roundtable
 
Bootstrap 5 ppt
Bootstrap 5 pptBootstrap 5 ppt
Bootstrap 5 ppt
 
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
 

Similar to Architecting with Style

Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSSanjoy Kr. Paul
 
Teams, styles and scalable applications
Teams, styles and scalable applicationsTeams, styles and scalable applications
Teams, styles and scalable applicationsVittorio Vittori
 
Perch, Patterns and Old Browsers
Perch, Patterns and Old BrowsersPerch, Patterns and Old Browsers
Perch, Patterns and Old BrowsersRachel Andrew
 
Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017
Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017
Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017La Drupalera
 
Bootstrap for Beginners
Bootstrap for BeginnersBootstrap for Beginners
Bootstrap for BeginnersD'arce Hess
 
Graphic Design For Web
Graphic Design For WebGraphic Design For Web
Graphic Design For WebDeniz Gökçe
 
No code stewardship - No Code Conf 2019 Demo Theater
No code stewardship - No Code Conf 2019 Demo TheaterNo code stewardship - No Code Conf 2019 Demo Theater
No code stewardship - No Code Conf 2019 Demo TheaterWebflow
 
The CSS Handbook
The CSS HandbookThe CSS Handbook
The CSS Handbookjackchenvlo
 
The Future State of Layout
The Future State of LayoutThe Future State of Layout
The Future State of LayoutStephen Hay
 
Reworking our-workflows
Reworking our-workflowsReworking our-workflows
Reworking our-workflowsnolly00
 
Scalable front-end architecture with Bootstrap 3 + Atomic CSS
Scalable front-end architecture with Bootstrap 3 + Atomic CSSScalable front-end architecture with Bootstrap 3 + Atomic CSS
Scalable front-end architecture with Bootstrap 3 + Atomic CSSHayden Bleasel
 
Meetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - GutenbergMeetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - GutenbergEvan Mullins
 
Meetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - GutenbergMeetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - GutenbergMickey Mellen
 
Project folder-structure-
Project folder-structure-Project folder-structure-
Project folder-structure-Daniel Downs
 
Advance Css 1194323118268797 5
Advance Css 1194323118268797 5Advance Css 1194323118268797 5
Advance Css 1194323118268797 5dharshyamal
 
Advance Css
Advance CssAdvance Css
Advance Cssvijayta
 
Know the reason behind choosing bootstrap as css framework
Know the reason behind choosing bootstrap as css frameworkKnow the reason behind choosing bootstrap as css framework
Know the reason behind choosing bootstrap as css frameworkOmkarsoft Bangalore
 
Design and CSS
Design and CSSDesign and CSS
Design and CSSnolly00
 

Similar to Architecting with Style (20)

Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSS
 
Teams, styles and scalable applications
Teams, styles and scalable applicationsTeams, styles and scalable applications
Teams, styles and scalable applications
 
Perch, Patterns and Old Browsers
Perch, Patterns and Old BrowsersPerch, Patterns and Old Browsers
Perch, Patterns and Old Browsers
 
Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017
Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017
Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017
 
Bootstrap for Beginners
Bootstrap for BeginnersBootstrap for Beginners
Bootstrap for Beginners
 
Graphic Design For Web
Graphic Design For WebGraphic Design For Web
Graphic Design For Web
 
No code stewardship - No Code Conf 2019 Demo Theater
No code stewardship - No Code Conf 2019 Demo TheaterNo code stewardship - No Code Conf 2019 Demo Theater
No code stewardship - No Code Conf 2019 Demo Theater
 
The CSS Handbook
The CSS HandbookThe CSS Handbook
The CSS Handbook
 
The Future State of Layout
The Future State of LayoutThe Future State of Layout
The Future State of Layout
 
Reworking our-workflows
Reworking our-workflowsReworking our-workflows
Reworking our-workflows
 
Scalable front-end architecture with Bootstrap 3 + Atomic CSS
Scalable front-end architecture with Bootstrap 3 + Atomic CSSScalable front-end architecture with Bootstrap 3 + Atomic CSS
Scalable front-end architecture with Bootstrap 3 + Atomic CSS
 
Meetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - GutenbergMeetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - Gutenberg
 
Meetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - GutenbergMeetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - Gutenberg
 
Project folder-structure-
Project folder-structure-Project folder-structure-
Project folder-structure-
 
Advance Css 1194323118268797 5
Advance Css 1194323118268797 5Advance Css 1194323118268797 5
Advance Css 1194323118268797 5
 
Advance Css
Advance CssAdvance Css
Advance Css
 
Fewd week7 slides
Fewd week7 slidesFewd week7 slides
Fewd week7 slides
 
Know the reason behind choosing bootstrap as css framework
Know the reason behind choosing bootstrap as css frameworkKnow the reason behind choosing bootstrap as css framework
Know the reason behind choosing bootstrap as css framework
 
Design and CSS
Design and CSSDesign and CSS
Design and CSS
 
A forest of designs without subthemes
A forest of designs without subthemesA forest of designs without subthemes
A forest of designs without subthemes
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"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...Fwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"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...
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

Architecting with Style

  • 2. Hi! I’m Tim Knight Director User Experience @ GravityFree Studios Organizer of the St. Petersburg Front-End Meetup www.iamtimknight.com
  • 3. This isn’t a talk about Joomla, it’s a talk about designing things.
  • 4. CSS gets a bad wrap because we rarely spend the time understanding it the way we should.
  • 5. Looking at today • Building grid systems by hand. • When to use Flexbox vs. Layout Grid • Using Sass mixins to abstract rules and complexities. • Automating our duplication cleanup. • When you should and shouldn’t use CSS Variables. • Thinking about your design objects as isolated context-aware components (spoiler… component queries!). • If you aren’t already, start looking at your front-end design systems as an evolving piece of software.
  • 6. This won’t be a detailed talk about each item. We’ll touch on some items for each concept to get you thinking.
  • 7. Where this all began In a 15 year-old product begging for a redesign
  • 8. • Based on a 960px 12-column grid • Separate desktop and mobile sites • jQuery and other ad-hoc plugins • Product cards had various undocumented visual states • Layout inconsistencies • Random accessibility issues
  • 9. Building the grid Forget Bootstrap and embrace your destiny
  • 13. Our goal was to go bigger. We went with a fluid grid that would max-out at 1440px wide.
  • 14.
  • 15.
  • 16. Placing items on the grid is done using their column and row numbers.
  • 17.
  • 18.
  • 19. If you really need “offsets”
  • 20.
  • 21.
  • 22. Using CSS Layout Grid is also about taking you out of the mindset of feeling like you need a full grid on everything.
  • 23. CSS Layout Grid is a two-dimensional grid. Meaning everything has a column and row position. Unbalanced grids can’t be centered—leave that to Flexbox.
  • 24. Abstracting responsive Using Sass loops & mixins to simplify design
  • 25.
  • 26. The syntax for media queries was always hard for my brain to remember.
  • 27.
  • 28. This had the added benefit of centralizing all my sizing in one place. But accessing the data needed nuance.
  • 29.
  • 30.
  • 31.
  • 32. Now we can generate column classes
  • 33.
  • 34. HOLD UP That seems like a lot of bullshit for CSS Layout Grid.
  • 35.
  • 36.
  • 37. Cleaning up the mess Using Gulp to kill repetition and process your Sass
  • 38. Dropping media queries everywhere can get really messy. But you can automate your build process to clean that up.
  • 39.
  • 40.
  • 41.
  • 42. Summing up what this gives us • Automatically vendor prefixes our CSS, including the old Microsoft CSS Grid prefixes. • Source Maps for uncompressed versions. • Compiled Sass • Merged Media Queries • Minified CSS
  • 43. When to use variables From Sass to CSS variables and back again
  • 44.
  • 45.
  • 46. CSS Variables allow added flexibility to set custom values that can be scoped to a class or even changed with JavaScript.
  • 47.
  • 49. Use CSS variables for… • Values that can change during run time. • Values that are changed based on JavaScript. • Color schemes that use a specific set of colors.
  • 50. Use Sass variables for… • Values you want to be compiled into your CSS. • Values you want to use Sass’ color functions with (e.g. darken, lighten, etc.). • Values used for conditional checking (like $debug: true;)
  • 51. Directing your navigation The power of Flexbox in the simplest of items
  • 52. This isn’t just about navigation
  • 53. Flexbox can really replace everything we once used floats or display: inline for in a way that’s more efficient to manage UI items. Leave the layout stuff for Grid.
  • 54.
  • 55.
  • 56. Use breakpoints to change direction
  • 57.
  • 58.
  • 59. This puts us on the path for self- contained components
  • 60.
  • 61. Thinking in components Design the page, but code the component
  • 62. Let’s talk about the design process
  • 63. Instead of programming the front-end as a page, based on a design composition, break your comp apart into components and build a component sheet to build all your pages.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68. This becomes your basis for documentation and creates a way to catch inconsistencies or issues in your CSS specificity.
  • 69. Dealing product cards Context-aware and self-contained components
  • 70. I’m a nerd for great card patterns
  • 71. See Design Better Cards from Andrew Coyle
  • 72. Flexbox and CSS Grid Layout provide great solutions for things like column management and reflowing content. However, there are often other considerations based on the component’s placement you’ll want to make. Contrast, hierarchy, or visual weight just to name a few.
  • 73.
  • 74. Container/Element Queries solve this problem. But they don’t actually exist.
  • 75. See Element Queries for CSS by Tommy Hodgins What might they look like?
  • 76. Using eq.js • A small JavaScript polyfill of 2KB • Uses a data attribute on the component to define sizes • Has a Sass mixin to make writing components even easier
  • 77.
  • 78. Demos and code samples https://github.com/timknight/container-queries-presentation/
  • 79. Apply constant care Pruning and organizing your code doesn’t end
  • 80. Treat your front-end system as a living document. Schedule code reviews and continue to make small updates throughout the life of it.
  • 81. “The cowards never started and the weak died along the way. That just leaves us, ladies and gentlemen. Us.” — PHIL KNIGHT, NIKE
  • 83. Building a Blog 9 9. Building a Blog A lot of my clients started using a CMS because they wanted to start blogging. Of course, many of them stopped blogging within the next 90 days, but that’s beside the point. Blogging is often a top requested feature for most CMSs and is often the reason why solutions like WordPress are given a lot of priority. Even if you’re not building a blog, you can use this same process for building news archives or other similar date- sorted content for your website. To do this, Craft CMS has a Section Type called a Channel. Unlike Structures which we covered in the previous chapter, Channels are sorted by the publishing date which makes them perfect for blogs or other news-based,date-sorted content on your site. Creating the Section First we’re going to into the Settings > Sections and create a new section. To keep things simple for now, we’ll just name this section “Blog” with a handle of “blog”. Finally,just make sure that“Channel”is selected as your Section Type. Building with Craft 74 Creating a Team Directory ! If you want to edit the image file name or the image title. Just double check on the image asset box. ! Building with Craft 62 Designing Templates and Layouts with Twig 6 6. Designing Templates and Layouts with Twig One of the most refreshing aspects of using Craft CMS is the use of the Twig templating language. Of course there are ways to use Twig within other platforms like WordPress, Drupal, and even your custom PHP projects, but having Twig built in as a first-class citizen in Craft without having to do any special configuration will help keep you from losing your mind as you work on your projects. Okay, first—let’s talk about layouts. It’s common to find a project where there is a separate header and footer file that are included within all files. Twig works a little differently where you can “extend” a file from your page and the effectively overwrite a block of that extended file’s content. This results in giving you a single file for both your header and footer to act as your layout. Let’s start putting together a layout to see how this works in practice. W ithin our templates folder let’s create another folder called _layouts. I like to use an underscore on files that aren’t directly accessed are that act as included or partial files. W ithin that folder we’re going to create a new file called main.twig which will act as our main layout. Craft CMS supports files with either the html extension or the twig extension. I tend to prefer using the twig extension so regardless of the text editor I’m Building with Craft 30 Table of Contents Preface iii ........................................................................................................... What is Craft CMS? iv ............................................................................................... Who Should Read This Book? iv ............................................................................... Legal v ....................................................................................................................... About the Author vi ........................................................................................... 1. Power for Front-End Developers 1 .............................................................. Part I: Craft Fundamentals 2. Installing Craft CMS 3 ................................................................................... Downloading and Installing MAMP 4 ........................................................................ Downloading Craft CMS 7 ......................................................................................... Connecting Craft to MySQL 11 ................................................................................. Finalizing Your Installation 15 .................................................................................... Deleting Admin Defaults 17 ....................................................................................... Selecting Your License 18 ......................................................................................... Managing Site Configuration 20 ................................................................................ 3. Setting Up Multiple Environment Support 21 ............................................. 4. Organizing Site Assets 24 ............................................................................ Adding Static Assets 24 ............................................................................................ Creating an Asset Source for Uploads 24 ................................................................. 5. Section Types, Entry Types, and Fields 28 .................................................. Defining a Section Type 28 ........................................................................................ Single 28 .............................................................................................................. Channel 28 ........................................................................................................... Structure 28 .......................................................................................................... Creating New Fields 29 ............................................................................................. 6. Designing Templates and Layouts with Twig 30 ........................................ Extending Our Layout 33 ........................................................................................... Including Partials 35 .................................................................................................. Building with Craft i Get updates at www.iamtimknight.com I am writing a book.
  • 84. thank you. Tim Knight iamtimknight.com Find this and other talks at https://speakerdeck.com/timknight