Write the stylesheets of tomorrow today by preparing for a plethora of screens and devices.
Expand the influence of CSS in a smart world by focusing on writing stylesheets for interactive TVs and the HTML5 native elements canvas and buttons.
This session will demonstrate best practices of interactive television front-end development as well as device agnostic CSS Styling of HTML5 elements for JavaScript clients that run GNU/Linux machines.
Underlying all technical specifications the design principles of modularity, efficiency, responsiveness, and flexibility will be emphasized and their impact on writing CSS code that contribute to creating adaptable yet platform appropriate interconnected components.
2. Anatomy of Web
Projects
photo credit http://blog.kjempekjekt.com/2012/12/23/ferris-gjr-event-sourcing-i-ui-luke-23-2012/
3. Physical Object
+
Controller, Sensor and Actuators
+
Internet
=
Internet of Things
Anatomy of IoT
Projects
photo credit Adrian McEwen, Hakim Cassimally. Designing the Internet of Things. Chapter 7 Prototyping Online Components
15. Embedded or Remote
1. Files can be served off of an SD
card - Not terribly fast, but so
far seems to work.
2. Local network can store your
JS and CSS files - point to
those as external resources.
3. Local web server -client
request data direct from
microcontroller
4. Microcontroller push data to
the server database.
photo credit: http://internetofthings-pune.blogspot.in/2013/07/this-is-open-source-home-automation.html
16. Embedded CSS Problems
1. Try to embed CSS into microcontroller and
does not compile
2. Use image links as buttons or Styles were
generated at www.cssbuttongenerator.com
3. Buggy JS to change CSS properties
according to the status of microcontroller
4. client.println("<style type="text/css">");
5. “The stylesheet is optional…”
6. Usual drab grey buttons in your web browser
but the application will still work.
18. Interactive TVs
“Websites are never going to look that great on a TV
unless they are designed for their resolutions...”
CNET TV Reviewer
“a Linux device configured with a Webkit-based browser
to run web pages and applications”
https://securityledger.com/2013/08/samsung-smart-tv-like-a-web-app-riddled-with-
vulnerabilities/
19. e.g. Google TV Design Principles
source: https://developers.google.com/tv/web/docs/design_for_tv
20. Layout
1. achieve “intended layout”
using float, calc() or flex box
2. resolutions (720p or 1080i/p)
div {
border: solid 1px;
float: left;
margin: 1em;
padding: 0 1em;
width: calc(100%/7 - 6em);
}
21. Scrollbars
1. overflow: hidden on the body
2. use JS to move content into
view
<script type="text/javascript">
function MoveIntoView (alignToTop) {
var element = document.getElementById ("elementID");
element. scrollIntoView (alignToTop);
}
</script>
html, body {
height: 100%;
overflow: hidden;
}
22. CSS Zoom property
1. impacts quality and
performance
2. design expecting white
space around pages
img {
zoom: 1;
*/ normal */
}
img:nth-child(2) {
zoom: 200%;
*/ percentage or number e.g. 2 = 200% /*
}
23. div {
border: solid 1px;
float: left;
margin: 1em;
padding: 0 1em;
width: calc(100%/10 - 9em);
}
..
div:nth-child(8), div:nth-child(9), div:
nth-child(10) {
display: none;
}
Selections above the fold
1. reduce categories
2. hide DIV elements with
“display: none”
24. Browser Specific
1. Check HTML5 Rocks
2. Browser specific support
3. *Others: OperaTV Browser,
Kylo
div {
-webkit-transform: scale(1.5);
}
div {
-webkit-transform: scale(2.0);
}
26. <button>
“use a button element. They can be beautifully styled,
have in-built keyboard support and various states, and
they can even be disabled using an attribute. By using
attribute selectors in your CSS you can style them.”
Christian Heilmann. Smashing Book #4 — New Perspectives on Web Design.
Chapter 3 The Vanilla Web Diet
50. <canvas>
“Because the canvas is an HTML element, you can use
CSS styles to modify its position, assign it a background
color or image, add a border, and so on. In Safari and
other WebKit-based browsers, you can use WebKit
transitions to smoothly animate changes in CSS
properties. Because the canvas can have a transparent
background, you can use CSS to create animated
graphics that roam freely across the webpage.”
https://developer.apple.com/library/safari/documentation/audiovideo/conceptual/html-
canvas-guide/ModifyingtheCanvaswithCSS/ModifyingtheCanvaswithCSS.html
57. SVG
“SVG content styled with CSS [CSS2]:
CSS is a widely implemented declarative language for
assigning styling properties to XML content, including
SVG. It represents a combination of features, simplicity
and compactness that makes it very suitable for many
applications of SVG. SVG Tiny 1.2 does not require
support for CSS selectors applied to SVG content.
Authors must not rely on external, author stylesheets to
style documents that are intended to be used with SVG
Tiny 1.2 user agents.”
http://www.w3.org/TR/SVGMobile12/styling.html
58. SVG cont’d
“The ‘class’ attribute assigns one or more class names
to an element. The element may be said to belong to
these classes. A class name may be shared by several
element instances. The ‘class’ attribute has several
roles: As a style sheet selector (when an author wishes
to assign style information to a set of elements).”
http://www.w3.org/TR/SVGMobile12/styling.html
83. #IoT needs more CSS!
“… The expertise required to make an Internet ‘thing’ is
vast. However, this means that the playing field for
making such a connected device is astonishingly level.
Whatever your skills and interests, you are well placed
as anyone to start experimenting and building. There
really is no better time to enter the exciting world of the
Internet of Things”
Adrian McEwen, Hakim Cassimally. Designing the Internet of Things.
Chapter 1 The Internet of Things: An Overview
84. THE CSS
of the
INTERNET
OF THINGS
THANK YOU!
Get in touch:
twitter: @uxcodeline
email: luis@teknolog.io
Additional credits for code/project samples: Leonardo Amico, James
Miller, Julian Garnier, Lasse Lukari & Dhiraj Jadhao