DOMINATE THE THEME LAYER August 21st.. Jesper Wøldiche Rahkonen Themer / architect at Bysted. Markup Marine / Journalist / Frontend United

Slides:



Advertisements
Similar presentations
Introduction to HTML
Advertisements

MA foundation Creating webpages using XHTML (part 1) Simon Mahony CCH
Chapter 1: Introduction. Contents Whats New in Dreamweaver CS4? The Dreamweaver CS4 Interface Setting Up a Site Creating a Web Page Adding Text to Your.
Microsoft ® Office Word 2007 Training Header and footer basics Sweetwater ISD presents:
Become a Panels Rockstar. Audience Survey Have you tried Panels? Are you a …. –Themer / Designer? –Developer / Code Junkie? –Information Architect?
Moving stuff around on your Drupal web pages Alex Bergin / Dept. Agriculture &
DOCUMENT TYPES. Digital Documents Converting documents to an electronic format will preserve those documents, but how would such a process be organized?
WI.org Site Training Laura Peterson 3/31/2014.
Learn the techniques to create a SharePoint 2010 web site from an existing branded web site.
Programming Club IIT Kanpur. Work environment Before you begin coding,always set up your work environment to your needs IDE Notepad++ Sublime Text 2.
Cascading Style Sheets: Basics I450 Technology Seminar Copyright 2003, Matt Hottell.
HTML / CSS – Basics Why the heck are we doing this?
Making Things Look Nice: Visual Appearance and CSS CMPT 281.
A really fairly simple guide to: mobile browser-based application development (part 1) Chris Greenhalgh G54UBI / Chris Greenhalgh
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Seattle Drupal Clinic Introduction to Drupal and Web Content Management.
HTML Hypertext Markup Language –First proposed by CERN in 1989 –It is non-linear so it allows you to jump from place to place –Markup refers to the structure.
HTML and Web Page Design Presented by Frank H. Osborne, Ph. D. © 2005 ID 2950 Technology and the Young Child.
Build a CMS Website. The topics this chapter covers are: What is CMS ? What you can do with CMS The benefits and disadvantages of using a content management.
Drupal Workshop Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology, Drupal technology, directories.
 Using Microsoft Expression Web you can: › Create Web pages and Web sites › Set what you site will look like as you design it › Add text, images, multimedia.
TOP 20 MISTAKES YOU WILL MAKE IN YOUR 1ST DRUPAL PROJECT IZTOK SMOLIČ, ZAGREB.
Creating a Simple Page: HTML Overview
HTML & CSS A brief introduction. OUTLINE 1.What is HTML? 2.What is CSS? 3.How are they used together? 4.Troubleshooting/Common problems 5.More resources.
IPUB 100 Lesson 2 Instructor Mark Lamontagne Homework Review.
Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
Drupal Training Syllabus Chaitanya Lakshmi
Multimedia & The World Wide Web winny HCI 201 Multimedia and the www.
Creating an Expression Web Site
© Ms. Masihi.  The Dreamweaver Welcome Screen first opens when you start Dreamweaver.  This screen gives you quick access to previously opened files,
Website Development with Dreamweaver
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
HTML | DOM. Objectives  HTML – Hypertext Markup Language  Sematic markup  Common tags/elements  Document Object Model (DOM)  Work on page | HTML.
JAOIT 8.  Dreamweaver is a program for creating web pages and managing websites without having to type HTML code.  WYSIWYG – What you see is what you.
Session 1 SESSION 1 Working with Dreamweaver 8.0.
Chapter 13. Applets and HTML HTML Applets Computer Programming with JAVA.
IT204 - Web Scripting and Authoring I Introduction to Dreamweaver Unit 6.
Presented by Graduate Design Group 2 Meredith, Jennifer, Cammay and Diane.
© 2011 Delmar, Cengage Learning Chapter 8 Using Styles and Design Style Sheets for Design.
What you don’t know you don’t know about Drupal 6 Dan Harris daneesia on drupal.org.
Drupal Overview Prepared by : Agustin D. Gumogda Jr. Instructor.
HTML: Hyptertext Markup Language Doman’s Sections.
Seattle Drupal Clinic Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology.
ECA 228 Internet/Intranet Design I Intro to Markup.
Use CSS to Implement a Reusable Design Selecting a Dreamweaver CSS Starter Layout is the easiest way to create a page with a CSS layout You can access.
HTML.
Session 2: Basic HTML HTML Coding Spring 2009 The LIS Web Team Presents.
PRESENTED BY GRADUATE DESIGN GROUP 2 MEREDITH, JENNIFER, CAMMAY AND DIANE How to build a web site in Dreamweaver.
Basic Steps to create a Website using HTML5. Hypertext Markup Language.
HTML HTML stands for Hyper Text Markup Language. HTML is used in making the base of a Website You can just use an online website maker like weebly.com.
HTML. HTML: What is it? – HTML stands for Hyper Text Markup Language – An HTML file is a text file containing small markup tags – The markup tags tell.
A gentle introduction to Bootstrap MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/18/
HTML Introduction HTML Editors HTML Basic HTML Elements HTML Attributes HTML Headings HTML Paragraphs HTML Formatting HTML Links HTML Head HTML CSS HTML.
HTML LAYOUTS. CONTENTS Layouts Example Layout Using Element Example Using Table Example Output Summary Exercise.
Glencoe Introduction to Web Design Chapter 4 XHTML Basics 1 Review Do you remember the vocabulary terms from this chapter? Use the following slides to.
INTRODUCTION ABOUT DIV Most websites have put their content in multiple columns. Multiple columns are created by using or elements. The div element is.
A gentle introduction to Bootstrap TDAP Jeremy Shafer Department of MIS Fox School of Business Temple University Spring
Objectives At the end of this session students will: Define the following terms in two sentences or less Website Web page Browser Html URL Hyperlink Explain.
Creating a Theme From Scratch in Drupal
One Content Type to Rule Them All
Intro to Web Development Links
Some Stuff You Need to Know
HTML / CSS Mai Moustafa Senior Web Designer eSpace eSpace.
Web Development 101 Workshop
HyperText Markup Language
Drupal 8: Twig and Component Libraries
Web Programming and Design
MAKING XSL-PCF PAGES FROM SCRATCH
Web Programming and Design
Presentation transcript:

DOMINATE THE THEME LAYER August 21st.

Jesper Wøldiche Rahkonen Themer / architect at Bysted. Markup Marine / Journalist / Frontend United

BEFORE WE GET STARTED… Last chance to run.

Focus on the themer.

It’s just OOCSS. Or smacss.

There will be slides with code.

There will be (more) slides without code.

Presenter will be opinionated.

Code available on Github.

IN THIS SESSION. A quick outline.

A beautiful beast. But a still a beast.

Submissive markup is efficient markup.

Overview of the session. 1 - The gentle way. 2 - The dominating way. 3 - Submissive markup in four easy steps. 4 - Tools of domination.

DANGERS OF A GENTLE TOUCH. A common approach.

Don’t let contrib trick you.

Results  Bloated css

Results  Bloated css  Tied to markup

Results  Bloated css  Tied to markup  Low extensibility

Results  Bloated css  Tied to markup  Low extensibility  High maintenance

COMMON PITFALLS Stuff you don’t want to do, really.

Style by Drupal module #form-campaignmonitor-signup h2 { Styles don’t go here… }

Style by Drupal module #form-campaignmonitor-signup h2 a { Styles don’t go here… } Low extensibility.

Style by Drupal module #form-campaignmonitor-signup h2 a { Styles don’t go here… } Low extensibility. Same block, different visuals.

Style by page or content type body.page-article h2 a { Styles don’t go here… } #maincontent.meta a { Styles don’t go here… }

Style by page or content type body.page-article h2 a { Styles don’t go here… } #maincontent.meta a { Styles don’t go here… } Redundant code.

Style by page or content type body.page-article h2 a { Styles don’t go here… } #maincontent.meta a { Styles don’t go here… } Redundant code. Expensive to maintain.

Using tags as selectors.node.node-meta span { Styles don’t go here… }

Using tags as selectors.node.node-meta span { Styles don’t go here… } Ties styles to markup. Harder to re-use.

Using tags as selectors.node.node-meta span { Styles don’t go here… } Ties styles to markup. Harder to re-use. Sometimes the date is, sometimes, sometimes

Using tags as selectors.node.node-meta span { Styles don’t go here… } Ties styles to markup. Harder to re-use. Sometimes the date is, sometimes, sometimes, etc. are the exceptions.

Styling headings by tag h1 { Styles don’t go here… } h2 { Styles don’t go here… } h3 { Styles don’t go here… }

Styling headings by tag h1 { Styles don’t go here… } h2 { Styles don’t go here… } h3 { Styles don’t go here… } Visual hierarchy will not always match outline

Styling headings by tag h1 { Styles don’t go here… } h2 { Styles don’t go here… } h3 { Styles don’t go here… } Visual hierarchy will not always match outline Low portability

Styling headings by tag h1 { Styles don’t go here… } h2 { Styles don’t go here… } h3 { Styles don’t go here… } Visual hierarchy will not always match outline Low portability All your headings might be

DOMINATE YOUR MARKUP! Trust me, it wants a firm hand…

Create architecture based on design and business logic.

Build web systems. extensible, robust, portable.

Style objects, not elements and pages.

Invest time for domination.

It pays off.

It pays off Lower maintenance,

It pays off Lower maintenance, Cheaper introduction of new features.

It pays off Lower maintenance, Cheaper introduction of new features. Leaner css and faster front-end.

Submissive markup in four easy steps. Analyze design and specs. Streamline and feedback with designer/client. Define objects and layout. Dominateand add styling hooks to markup.

ANALYZE Analyze design and specification.

Look beyond the markup and modules.

Identify recurring patterns.

Structural patterns.

Visual patterns.

Variations.

Bring the designer onboard. And strategist.

STREAMLINE Time to make your mark.

Streamline variations of common objects.

Option 1: Unify.

Option 2: Define rules for the variations.

DEFINE Define objects and structure.

Define objects from patterns.

SMACSS.

A suggested system Variations. Style. Typography. Structure. Grids.

[Photo: Print with handwritten notes.]

DOMINATE Let there be code…

Go with classes for web systems.

Use low specificity

Layer your objects. Title Content goes here.

So… Analyze Streamline Define Dominate!

TOOLS OF DOMINATION Let’s sink those styling hooks in.

It’s a matter of class.

Back to Views. Get it right to begin with.

The scary render arrays.

All-in-three tools for domination $vars['classes_array'] $vars['title_attributes_array']['class'] $vars[’content_attributes_array']['class']

The result. Title Content goes here.

function MYTHEME_preprocess_field (&$vars,$hook) { //add class to a specific field switch ($vars['element']['#field_name']) { case 'field_summary': $vars['classes_array'][] = 'text-teaser'; break; case 'field_location': case 'field_date': case 'field_price’: case 'field_website’: $vars['classes_array'][] = 'list-definition’; case 'field_deadline': case 'body': $vars['classes_array'][] = 'text-content'; break; } }

Conditions. function MYTHEME_preprocess_panels_pane (&$vars) { // Add styling classes to fields as panes. if ($vars['pane']->type == 'entity_field') { // Switch by field name. switch ($vars['content']['#field_name']) { case ‘field_name’: $vars['title_attributes_array']['class'][] = ’key’; … } } }

What makes you switch? Field name Block name Defining module View mode Region Path Combinations

Pick a function, any function. template_preprocess_page, template_preprocess_html, template_preprocess_block, template_preprocess_region, template_preprocess_field, template_preprocess_panels_pane.

THE ODD THREES OUT. Someone’s special.

Menus. function theme_menu_tree__MENU_NAME ($vars) { return ' '. $vars['tree']. ' '; }

Multi fields.

Forms. Only thing* scarier than ordinary render arrays.

CONCLUSION. So…

Thank you! Slides bit.ly/dominate-theme Tools for domination github.com/woeldiche/domination_tools Fireworks stencils github.com/woeldiche/markup_stencils

Tell me what you think. bit.ly/dominate-theme munich2012.drupal.org /program /sessions

Images Chain