Wednesday, October 21, 2015

This Week's HTML5 and Browser Technology News (Issue 211)

CSS commenting shenanigans, lazy loading images, responsive image support in Edge, and more.
Read this e-mail on the Web
HTML 5 Weekly
Issue 211 — October 21, 2015
SitePoint
A deeper-than-you’d-expect look at using loopholes in the CSS spec for ‘commenting’ out certain CSS properties without doing it the intended way.


Telerik Developer Network
Brian Rinaldi discusses a number of methods to reduce the initial weight of a web page by delaying the loading of images that are outside of the viewport.


Imgix  Sponsored
With imgix, integrating responsive images into your site could not be easier. imgix is fully-compatible with the srcset attribute, the picture element, and Client Hints. Learn how to start delivering responsive images in less than 30 minutes.

Imgix

Léonie Watson
When a parent/child relationship is evident visually, but isn’t represented in the DOM, ‘aria-owns’ can be used to establish that relationship in the accessibility layer.


Microsoft Edge Dev Blog
As of the latest Windows Insider Preview build, Edge supports srcset, sizes, and picture, a ‘suite of technologies that make up responsive images’. Even if you’re not interested in Edge, this post looks at how they work.


Creative Bloq
A quick look at the techniques you can use to detect and control screen orientation changes from an HTML5 game developer POV.


David Walsh
A discussion of some methods for making your apps available offline and an option for doing so in one line without relying on ServiceWorkers.


Paul Kinlan
The InputDeviceCapabilities API provides details about the underlying sources of input events via a ‘sourceCapabilities’ object.


Jobs

  • Web Applications Engineer at Nest Labs.With hundreds of thousands of Nest customers touching our apps daily to make their homes safer and more energy efficient, every member of our team can make a big impact and know the apps they develop will receive lots of visibility. Nest Labs
  • Have Top Companies Compete Over Hiring YouYou're in demand. Shouldn't companies come to you with offers upfront? We think so. Join the revolution and sign up for Hired today.  Hired.com

In brief

Curated by Peter Cooper and published by Cooper Press.
Want to post a job? E-mail us or use our self-serve system.

Unsubscribe : Change email address : Read this issue on the Web

Published by Cooper Press Ltd. Office 30, Lincoln Way, Louth, LN11 0LS, UK


by via HTML5 Weekly

Creating a Perspective Mockup in Sketch with MagicMirror

Though I often talk about both Sketch App and Photoshop, my slight crush on Sketch means I tend to spend more time with it.

However, the fact remains that I need to use both sometimes. One such example is when I’m designing for screens in Sketch App, but I want to mockup the screen as if it were being viewed on an actual device, and for that I need Photoshop’s “Smart Object” functionality. But why go through the effort?

Sometimes the visual aesthetic of a design doesn't really come to life until you take it off the flat canvas and show it off from a 3D perspective; in other words, how you might see it, realistically, with the naked eye.

Not only that, but it helps the mockup fit into a horizontal frame (for sharing on Behance and Dribbble) and many clients simply love how it looks.

Perspective mockups are very trendy, there’s no argument about it!

MagicMirror Plugin

MagicMirror Plugin

MagicMirror Plugin works like a Photoshop Action for Sketch, and there’s a terrific free version available. You design your screen in an artboard as normal, and a keyboard shortcut creates a sort-of smart object mockup of your screen.

Let's take it for a spin!

Getting Started

You can either use a screen that you’ve already designed or download a .sketch freebie, such as this epic Dark Dialer interface by Bootstrap Guru.

[author_more]
Atomic: A Faster Way To Design Beautiful Interactions?
Photoshop vs. Sketch: The Battle for the Cleanest HTML/CSS
The 10 Best Productivity Plugins for Sketch App
[/author_more]

Before you open it though, download the MagicMirror Plugin and try to open the .sketchplugin file that comes with it. Just like with Photoshop Actions, this will automatically install it.

Now you can open your .sketch design!

Dialer

Creating the Makeshift “Smart Object”

It’s not really a smart object, but it is smart. Press “A” to open the Artboard dialog in the inspector or simply Duplicate (command+d) the "source" artboard and remove its contents.

What we want to achieve here is two artboards of the same width and height, but one of them should be empty to ensure that our smart object retains the same aspect ratio as the design.

Press “R” to create a Rectangle and draw it out so that it fills up all of the whitespace in the new, empty artboard, then turn your eyes to the menu bar and hit the “Transform” tool.

Setting the Stage

It’s vital that we use Transform and not “Edit”; Edit will create an irregular shape whereas Transform will make sure that our shape retains the correct aspect ratio of our design.

Move the corners of the shape until you have the angle that you want. Perspective is assured if you’re using Transform.

Manipulating the Shape with the Transform Tool

It might be useful to save your favourite mockup shots in a single .sketch file so that you can use them as templates later on, or you download some of the mockups from the site: here’s a brilliant one.

Setting Up the Design to be Mirrored

We now need to connect our shape to the design so that they can be mirrored, but that’s really easy. Just make sure that the shape layer is renamed to match the artboard.

[caption id="attachment_117304" align="aligncenter" width="700"]Connecting the Screen to the Shape Connecting the Screen to the Shape[/caption]

Learning the Keyboard Shortcuts that Make It Happen

Press control+shift+m to start the mirroring (this works across “Pages” as well, like Shared Styles and Symbols). You might end up with something like this (below), but there are other keyboard shortcuts that we can utilise to achieve our aims.

[caption id="attachment_117305" align="aligncenter" width="700"]Rotating and Other Keyboard Shortcuts Rotating and Other Keyboard Shortcuts[/caption]

In our dilemma, we'll need to select the rectangle shape and use command+control+shift+r (I know, that's a crazy shortcut!) to rotate our design inside the shape; MagicMirror actually uses the “Fill” style to create a background image, but how they rotate it, I have no idea. It must be magic!

[caption id="attachment_117306" align="aligncenter" width="700"]Now Everything Is in Perspective Now Everything Is in Perspective[/caption]

Here're two other keyboard shortcuts to remember:

Continue reading %Creating a Perspective Mockup in Sketch with MagicMirror%


by Daniel Schwarz via SitePoint

Learn to Design a Responsive Landing Page with John Ashenden and Skillshare

8dbbfa73We’re stoked to finally kick off our Tutorials category in our Resources section!

The aim of the tutorials category is to provide our own articles or links to classes we think will help improve your One Page website design and development skills.

First up is a class we’d recommend on Designing a Responsive Landing Page.

Details are below but there are few things you need to know:

  • The class is a Premium class using the excellent Skillshare platform.
  • A Premium account only costs $9.99 per month to enrol (in unlimited online classes) but with THIS LINK you get your first month of Premium membership – absolutely free. So you can try Premium risk free and decided if you want to go all in.
  • Lastly, we want to mention there are also Free classes on Skillshare – not all pertaining to One Page website design though.

About This Class

skillshare-rwd-01Official title: Design a responsive landing page to promote your favorite movie or band

In this class, you’ll learn the fundamentals of responsive design. You will walk through the steps needed to create a mobile-first site or web-app, how to prepare your design files, techniques for adjusting content and layout, and even a basic introduction to how this translates to HTML and CSS.

Web Designers, UX Designers, and Developers anxious to learn the fundamentals of responsive design, this is the class for you.


What You’ll Learn

  • Principles of Responsive Design. You’ll learn the fundamentals of Responsive Design, why it’s important, how it can benefit your audience, and even improve your designs.
  • Laying the Foundation. We’ll walkthrough the development of wireframes for a responsive website.
  • Applying Your Design. From wireframe to mockup, you’ll be using typography, hidden elements, and margins to your advantage.
  • Design to Development (Optional). Learn how to use HTML and CSS to manipulate your site’s structure and content.

What You’ll Make

skillshare-rwd-02As a final project, students will submit a single-page design for a website promoting your favorite band or movie. The availability of high-quality photographs, posters and even videos for bands or movies, makes an ideal candidate for visually rich and engaging websites.

Your responsive landing page will be designed to fit at least 3 screen sizes – mobile, tablet, and laptop. Ambitious students can take their project beyond, creating additional designs to fit widescreen monitors or even convert their designs to a functioning website.

This is a design-focused course, though a basic introduction to responsive development will be presented for those students eager to bring their designs to life.


About Your Teacher

John-Ashenden Meet John Ashenden (twitter)

“My portfolio includes 6 years as Grooveshark SVP and Creative Director, where I helped build one of the largest on-demand music services in the world. I was the creative force behind many first-to-market branded experiences that leveraged Grooveshark’s market in conjunction with Fortune 500 brands.”

“Today, I run H1 – a web and mobile design, branding, and development studio in Brooklyn New York helping companies like Salesforce, iHeart Radio, Quirky, Desk.com, and many others define their brand and reach new customers both online and offline. I am also a partner in The BKRY, a platform producer and proving ground for new applications Socialist and Sponsr.”


Enrol Free Now

The class is a Premium class but if you enrol with this linkK you get your first month of Premium membership – absolutely free. So you can try Premium risk free and decided if you want to go all in at $9.99 after that.


by Rob Hope via One Page Love

This Week in Mobile Web Development (#79)

Read this on the Web

Mobile Web Weekly October 21, 2015   #79
Holly Schinsky recommends
Comparing The Top Frameworks For Building Hybrid Mobile Apps — A comparison of some of the most popular JavaScript frameworks available for building hybrid mobile apps with an overall score for each.
Tutorialzine
Holly Schinsky recommends
Don’t Wait for ServiceWorker: Adding Offline Support with One-Line — A discussion of some methods for making your apps available offline and an option for doing so in one line without relying on ServiceWorkers.
David Walsh
Brian Rinaldi recommends
The Viability of JS Frameworks on Mobile — Are the popular web frameworks suitable for building mobile pages? How do we address the poor performance of mobile web apps on mobile devices?
Henrik Joreteg
This issue is sponsored by Rangle.io
New Case Study: Creating a Comprehensive Social Media App Using Ionic & PhoneGap — Access a video and in-depth case study on the end-to-end journey building the Sprout at Work mobile application using Ionic Framework and PhoneGap.
Rangle.io

Holly Schinsky recommends
Template7: A Mobile-First JavaScript Template Engine — Template7 is a JavaScript template engine (with handlesbars-like syntax) optimized for mobile use.
iDangero.us
Holly Schinsky recommends
Using Content Security Policy to Make Apps More Secure — An in-depth guide to Content Security Policy and how to use it to prevent cross-site scripting (XSS) attacks on your apps.
60 devs
Peter Cooper recommends
Mozilla Publishes Study on Mobile Opportunity in Emerging Markets — “Approaches to local content creation: realising the smartphone opportunity,” explores how the right tools and education can result in a sustainable, inclusive mobile Web.
Mozilla
Brian Rinaldi recommends
Using npm Modules in NativeScript Mobile Apps — Todor Todev demonstrates how you can easily integrate npm modules into a NativeScript mobile app using the Telerik Platform.
Telerik Developer Network
Holly Schinsky recommends
The Web Vs. Native Debate Comes To Virtual Reality — Diversification of devices in conjunction with the need for consistent performance of VR content across platforms is driving web apps to become the more dominant choice over native apps.
Read Write
Holly Schinsky recommends
Debugging Your Apache Cordova iOS App With Safari — How to troubleshoot your hybrid apps using an iOS simulator and the Safari web browser.
Nic Raboy's Blog
Peter Cooper recommends
Four Reasons The Mobile Web Will Force Us To Become Better Content Marketers
Marketing Land
Brian Rinaldi recommends
Important note for targeting iOS Emulators in Cordova — How to update the supported list of emulators when using the Cordova CLI.
Raymond Camden
Brian Rinaldi recommends
Accelerated Mobile Pages - I’ve Got More Questions than Answers — After playing with AMP, Andy Davies found mixed results and wonders if AMP simply reminds us that we failed at building a performant web.
Andy Davies
Brian Rinaldi recommends
AMPed up — Jeremy Keith thinks that Google with AMP, as well as Facebook and Apple with their own efforts, are going through a lot of effort to recreate RSS - essentially these are all alternative syndication options.
Jeremy Keith
Holly Schinsky recommends
Making Sense of Cordova Push Notification Options and APIs — Find out different options available for implementing push notifications in your mobile apps including how to configure them and various libraries and backend services available.
MSDN Blogs
Holly Schinsky recommends
ionic-conference-app: A demo conference app built with Ionic 2 — A sample conference app built with Ionic 2.
Ionic
Holly Schinsky recommends
Using Cordova Plugins in React Native (Android) — Learn how Cordova plugins can be leveraged for use with React Native.
Parashuram's blog
Curated by Brian Rinaldi and Holly Schinsky for Cooper Press.
Cooper Press is located at Office 30, Fairfield Enterprise Centre, Louth, LN11 0LS, UK
Update your email address
or stop receiving MWW here


by via Mobile Web Weekly

The Four Month Pitch: A Freelancer’s Struggle

Optimized-aboutpic

In September, I made the first successful pitch of my career. Fortunately, I was alone when I received the news, as I immediately pumped my fist and shouted in triumph. You would have thought I’d won the lottery.

In truth, that moment had been building up for four months, hence the disproportionate excitement.

I had been working as a freelance writer for a couple of years before I made the pitch, which was a story about Bernie Sanders, defeatist news headlines, and voter psychology. The bulk of my writing jobs were (and still are) coming from referrals, and my writing “beat” never strayed far from the digital marketing realm, but I’d been wanting to stretch my writing muscles and expand my repertoire for a long time.

Continue reading %The Four Month Pitch: A Freelancer’s Struggle%


by Joshua Kraus via SitePoint

PostCSS Deep Dive: Preprocessing with “PreCSS”

Pseudo-comments in CSS (Or, How Browsers Parse Styles)

The CSS spec does not mention it, but you can mimic C-style and/or Unix-style line comments in CSS files (with some caveats). Others have written about them before (see in particular, SitePoint’s Web Foundations post covering CSS Comments). The present post examines them in further detail.

CSS Comments

CSS parsers, per the spec, officially bless one style for comments, the multi-line comment from C-style languages, which uses a start token, /*, and an end token, */, as follows:

[code language="css"]
/*
characters between, and including, the start and
end tokens are ignored by the parser,
*/
[/code]

And so a rule declaration in comments will be ignored:

[code language="css"]
body {
background: red;
/*
background: white;
*/
}
[/code]

A block declaration in comments will be ignored:

[code language="css"]
/*
body {
background: red;
}
*/
[/code]

In each of those examples, we are using the comment syntax intentionally to instruct the parser to ignore the content.

However, we can do that by accident, as with malformed declarations, such as

[code language="css"]
body {
background: red /* missing semi-colon */
background: blue;
}
[/code]

In this example, neither background declaration is applied because of the missing semi-colon. The parser scans for the next semi-colon, determines the entire two-line statement is malformed, and so ignores the entire lexed content. The same thing happens if we leave out the property value altogether:

[code language="css"]
body {
background:
background: blue; /* this declaration is not applied */
}
[/code]

And that shows that we can use malformed declarations as…

Pseudo-comments

We’ll refer to these as “pseudo-comments” because, properly speaking, these are not comments that terminate at an end-of-line character. Instead they work by malforming the input that follows them, even on subsequent lines. And this is due to the error handling process for Rule sets, declaration blocks, and selectors:

“the whole statement should be ignored if there is an error anywhere in the selector, even though the rest of the selector may look reasonable in CSS 2.1.”

In the following example, taken from the spec, the second ruleset is ignored due to the presence of the invalid “&” character in the selector:

[code language="css"]
h1, h2 {color: green }
h3, h4 & h5 {color: red } /* <= ignored */
h6 {color: black }
[/code]

Again, in the following, the second and third declarations are ignored due to the presence of extra characters in the background property name:

[code language="css"]
body {
background: red;
xbackground: white; /* property name is not recognized */
y background: blue; /* property name is not well-formed */
}
[/code]

A quick tour around the English language keyboard shows the following special characters will act as single-line declaration comments:

[code language="css"]
selector {
~ property-name: ignored;
` property-name: ignored;
! property-name: ignored;
@ property-name: ignored;
# property-name: ignored;
$ property-name: ignored;
% property-name: ignored;
^ property-name: ignored;
& property-name: ignored;
* property-name: ignored;
_ property-name: ignored;
- property-name: ignored;
+ property-name: ignored;
= property-name: ignored;
| property-name: ignored;
\ property-name: ignored;
: property-name: ignored;
< property-name: ignored;
. property-name: ignored;
> property-name: ignored;
, property-name: ignored;
? property-name: ignored;
/ property-name: ignored;
}
[/code]

Rather than use just any character, though, stick with C and Unix convention, and use either # or //:

Continue reading %Pseudo-comments in CSS (Or, How Browsers Parse Styles)%


by David Kaye via SitePoint