Thursday, August 16, 2018

Chrome is developing an update which will allow pages to load much faster

Google Chrome is working on a new development which will allow pages to load faster than usual. When the company announced the upcoming feature in the previous year's January, it started testing it right away. It is estimated that the initial phase of testing went well, and therefore, the company...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Neha Zaidi via Digital Information World

End Family Fire

A digital experience that encourages families to reconsider their relationship with and behavior around guns in the home.
by via Awwwards - Sites of the day

Wednesday, August 15, 2018

Twitter Is On A Hunt To Remove The Accounts That Escaped Suspension

Twitter is adamant to remove the accounts that are problematic for the users and cause a bad name for the platform in general. The company is out on a hunt for the accounts that were previously suspended over misconduct or abuse. The owners who have made another account and would try their...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Mehwish Mehmood via Digital Information World

What To Do When You Get A Fake Bad Review [infographic]

In an age where people like to do their online research before buying a product or service, it’s very important for small businesses to have positive reviews. However, it’s also a fact of life on the internet that almost every business is on the receiving end of fake negative reviews, which can be...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Irfan Ahmad via Digital Information World

Instagram Is Personalizing The Public Polls On DMs

If you have found it difficult to share your opinions and thoughts out in the open, apart from the close circle of friends, sharing Instagram Polls must have been an issue for you, no matter how hard you’d wanted to have them. Well, this issue has now been addressed by the company as it rolls out...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Mehwish Mehmood via Digital Information World

Everything You Need To Know About Alignment in Flexbox

#353 — August 15, 2018

Read on the Web

Frontend Focus

webhint: A Linting Tool for Web Best Practices — A customizable (and extensible) tool that checks your site for accessibility, performance, security, and other concerns. Note: webhint is the new name for Sonarwhal.

JS Foundation

Everything You Need To Know About Alignment in Flexbox — A look at the alignment properties in Flexbox while discovering some basic rules to help remember how alignment on both the main and cross axis works.

Rachel Andrew

Highly Reliable, Scalable Object Storage Starting at $5 a Month — Manage, migrate, and control data any way you want, immediately, with no need for configuration. Learn more.

DigitalOcean sponsor

'Scroll Bouncing' and How It Works — A good understanding of the scroll bouncing effect (and how to prevent it, if you wish) is helpful for building any site that has fixed elements.

William Lim

Native Lazy Loading Coming to the Web Platform — You’d use the lazyload attribute on an image, say, to trigger the behavior. “To be clear, nothing is final yet and this might not become part of the spec,” says Feross, although IE and Edge already support it to some extent.

Feross Aboukhadijeh on Twitter

Browser Painting and Considerations for Web Performance — An explanation and case study on the impact the browser paint process has on web performance and why you should be mindful of it.

Georgy Marchuk

A Friendly Introduction to Flexbox for Beginners — Christian Krammer walks you through the basics of flexbox, showing how you can use flexbox to lay out specific page elements, and also how it can serve as a handy fallback method in browsers that don’t support CSS Grid.

SitePoint

💻 Jobs

Frontend Developer at X-Team (Remote) — We help our developers keep learning and growing every day. Unleash your potential. Work from anywhere. Join X-Team.

x-team

Find A FrontEnd Job Through Vettery — Vettery specializes in dev roles and is completely free for job seekers. Create a profile to get started.

Vettery

📘 Tutorials

Simple Interactive Pie Chart with CSS Variables & Houdini Magic

Ana Tudor

The Art of Debugging with Chrome's DevTools

Prashant Palikhe

▶  SVG Filters: The Crash Course

Sara Soueidan

Exploring SMACSS: Scalable and Modular Architecture for CSS — SMACSS provides a set of solid organizational guidelines for working with CSS.

Slobodan Gajic

The Future of JavaScript: 2018 and Beyond. Get the Whitepaper

Progress Kendo UI sponsor

The Generic Sensor API — Exploring the Generic Sensor API, which aims to provide a consistent API for different sensors.

Ruadhan O'Donoghue

Dynamic Resources with the Network Information API and Service Workers — The Network Information API allows developers to determine the connection types and the underlying connection technology that the user agent is using.

Dean Hume

A Web of Anxiety: Accessibility for People with Anxiety and Panic Disorders? — An angle to accessibility you may not have considered before.

David Swallow

📘 Articles and Opinion

Let's Serve Everyone Good-Looking Content — Whether or not their browser supports the latest layout model or not.

Hidde de Vries

Don't Miss SIGNAL: Twilio Customer & Developer Conference - Oct 17 & 18 — Level up your skills. See how the right set of API tools help build better customer experiences, faster.

twilio sponsor

Icon Fonts vs SVGs: Which One Should You Use In 2018? — Aren’t sure whether you should be using icon fonts or SVG icons?

Cody Arsenault

🔧 Code and Tools

Hex Naw: A Color Accessibility Testing Tool — Enter your colors and get contrast ratios and find out if your combos are suitable for text or not.

The Scenery

Vue CLI 3.0 Released — The standard build toolchain for Vue apps supports pre-configured webpack features, ES2017 transpilation, and PostCSS out of the box.

Evan You

Developer Tools for Every Customer Session – New in FullStory

Fullstory sponsor

Spirit App: Easy Realtime Animation For the Web — The app itself is here but this tutorial is, perhaps, a better way to understand why it’s useful.

Dennis Gaebel

React Chrome Extension Boilerplate — Boilerplate code for if you want to build a React-powered browser extension.

FullStack Academy Kiev

Line-Height Crop: A CSS Formula to Remove Top Space From Your Text — By way of a simple SCSS mixin.

Claudia Romano


by via Frontend Focus

Redesigning a Site to Use CSS Grid Layout

In this article, we’re going to see CSS Grid in action by creating a responsive multi-column website layout.

CSS Grid is a new, hot trend in web development these days. Forget about table layouts and floats: a new way to design websites is already here! This technology introduces two-dimensional grids which define multiple areas of layout with a handful of CSS rules.

Grid can make third-party frameworks such as 960gs or Bootstrap grid redundant, as you may easily do everything yourself! This feature is supported by all major browsers, though Internet Explorer implements an older version of the specification.

What We’re Going to Build

So, we were asked to create a typical website layout with a header, main content area, sidebar to the right, a list of sponsors, and a footer:

The initial starting point

Another developer has already tried to solve this task and came up with a solution that involves floats, display: table, and some clearfix hacks. We’re going to refer to this existing layout as "initial":

See the Pen SP: Multi-Column Layout With Floats by SitePoint (@SitePoint) on CodePen.

Until recently, floats were considered to be the best option to create such layouts. Prior to that, we had to utilize HTML tables, but they had a number of downsides. Specifically, such table layout is very rigid, requiring lots of tags (table, tr, td, th etc), and semantically these tags are used to present table data, not to design layouts.

But CSS continues to evolve, and now we have CSS Grid. Conceptually, it’s similar to an old table layout but can use semantic HTML elements with a more flexible layout.

Planning the Grid

First things first: we need to define a basic HTML structure for our document. Before that, let’s briefly talk about how the initial example works. It has the following main blocks:

  • .container is the global wrapper that has small margins to the left and to the right.
  • .main-header is the header that contains the .logo (occupying 20% of the space, floating to the left) and the .main-menu (occupying 79% of the space, floating to the right). The header is also assigned a hacky fix to clear the floats.
  • .content-area-wrapper wraps the main .content-area (occupying 66.6% of the space minus 1rem reserved for margin, floating to the left) and the .sidebar (occupying 33.3% of the space, floating to the right). The wrapper itself is also assigned with a clearfix.
  • .sponsors-wrapper contains the logos of the sponsors. Inside, there’s a .sponsors section with the display property set to table. Each sponsor, in turn, is displayed as a table cell.
  • .footer is our footer and spans to 100% of the space.

Our new layout will be very similar to the initial one, but with one exception: we won’t add the .main-header and .content-area-wrapper wrappers because the clearfixes won’t be required anymore. Here is the new version of the HTML:

<div class="container">
  <header class="logo">
    <h1><a href="#">DemoSite</a></h1>
  </header>

  <nav class="main-menu">
    <ul>
      <li class="main-menu__item"><a href="#">Our clients</a></li>
      <li class="main-menu__item"><a href="#">Products</a></li>
      <li class="main-menu__item"><a href="#">Contact</a></li>
    </ul>
  </nav>

  <main class="content-area">
    <h2>Welcome!</h2>

    <p>
      Content
    </p>
  </main>

  <aside class="sidebar">
    <h3>Additional stuff</h3>

    <ul>
      <li>Items</li>
      <li>Are</li>
      <li>Listed</li>
      <li>Here</li>
      <li>Wow!</li>
    </ul>
  </aside>

  <section class="sponsors-wrapper">
    <h2>Our sponsors</h2>

    <section class="sponsors">
      <figure class="sponsor">
        <img src="https://via.placeholder.com/150x150">
      </figure>

      <figure class="sponsor">
        <img src="https://via.placeholder.com/200x150">
      </figure>

      <figure class="sponsor">
        <img src="https://via.placeholder.com/100x200">
      </figure>

      <figure class="sponsor">
        <img src="https://via.placeholder.com/100x100">
      </figure>

      <figure class="sponsor">
        <img src="https://via.placeholder.com/200x200">
      </figure>
    </section>

  </section>

  <footer class="footer">
    <p>
      &copy; 2018 DemoSite. White&amp;Sons LLC. All rights (perhaps) reserved.
    </p>
  </footer>
</div>

Note that you may utilize the body as the global .container; that’s just a matter of preference in this case. All in all, we have six main areas:

  1. Logo
  2. Menu
  3. Main content
  4. Sidebar
  5. Sponsors
  6. Footer

Usually it’s recommended that you implement a mobile-first approach. That is, you start from the mobile layout and then add styles for larger screens. This isn’t necessary in this case, since we’re adapting an initial layout that already falls back to a linearized view on small-screen devices. Therefore, let’s start by focusing on the grid’s implementation, and after that talk about responsiveness and fallback rules. So, return to our scheme and see how the grid columns can be arranged:

Grid column arrangement

So, I propose having three columns (highlighted in red) and four rows (highlighted in blue). Some areas, like the logo, are going to occupy only one column, whereas others, like main content, are going to span multiple columns. Later we can easily modify the layout, move the areas around, or add new ones.

Following the scheme, give each area a unique name. These will be used in the layout defined below:

.logo {
  grid-area: logo;
}

.main-menu {
  grid-area: menu;
}

.content-area {
  grid-area: content;
}

.sidebar {
  grid-area: sidebar;
}

.sponsors-wrapper {
  grid-area: sponsors;
}

.footer {
  grid-area: footer;
}

Now set the display property to grid, define three columns and add small margins to the left and right of the main container:

.container {
  display: grid;
  margin: 0 2rem;
  grid-template-columns: 2fr 6fr 4fr;
}

display: grid defines a grid container and sets a special formatting context for its children. fr is a special unit that means "fraction of the free space of the grid container". 2 + 6 + 4 gives us 12, and 6 / 12 = 0.5. It means that the middle column is going to occupy 50% of the free space.

I would also like to add some spacing between the rows and columns:

.container {
  // ...
  grid-gap: 2rem 1rem;
}

Having done this, we can work with individual areas. But before wrapping up this section, let’s quickly add some common styles:

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  font-family: Georgia, serif;
}

body {
  background-color: #fbfbfb;
}

h1, h2, h3 {
  margin-top: 0;
}

header h1 {
  margin: 0;
}

main p {
  margin-bottom: 0;
}

Good! Now we can proceed to the first target, which is going to be the header.

The post Redesigning a Site to Use CSS Grid Layout appeared first on SitePoint.


by Ilya Bodrov-Krukowski via SitePoint