ex

How nature works: rethinking labor on a troubled planet / edited by Sarah Besky and Alex Blanchette, School for Advanced Research Press, Santa Fe

Rotch Library - GF75.H69 2019




ex

Wild at heart: America's turbulent relationship with nature, from exploitation to redemption / Alice Outwater

Rotch Library - GF75.O87 2019




ex

Planning for the planet: environmental expertise and the international union for conservation of nature and natural resources, 1960-1980 / Simone Schleper

Hayden Library - QH75.S257 2019




ex

Working with dynamic crop models: methods, tools and examples for agriculture and environment / Daniel Wallach, David Makowski, James W. Jones, Francois Brun

Hayden Library - SB112.5.W35x 2019




ex

Residential property price indexes: theory and practice / W. Erwin Diewert, Kiyohiko G. Nishimura, Chihiro Shimizu, Tsutomu Watanabe

Online Resource




ex

Forest pest and disease management in Latin America: modern perspectives in natural forests and exotic plantations / Sergio A. Estay, editor

Online Resource




ex

Insect sex pheromone research and beyond: from molecules to robots / Yukio Ishikawa, editor

Online Resource




ex

Landscape patterns in a range of spatio-temporal scales Alexander V. Khoroshev, Kirill N. Dyakonov, editors

Online Resource




ex

Fascinating CSS Grid Layout Examples and Tutorials

CSS Grid is one of the most powerful tools available to developers. The simple module allows you to create entire website layouts, responsive galleries, and other cool effects. With enough creativity, you can do a lot of interesting things using …




ex

Hexatic phase in a model of active biological tissues

Soft Matter, 2020, 16,3914-3920
DOI: 10.1039/D0SM00109K, Paper
Anshuman Pasupalak, Li Yan-Wei, Ran Ni, Massimo Pica Ciamarra
Epithelial cell tissues undergo a solid–liquid transition, e.g. as the motility of the cells increases. We find an intermediate hexatic phase in between the solid and the liquid ones, and the transition to follow the KTHNY scenario.
The content of this RSS Feed (c) The Royal Society of Chemistry




ex

Assessing the Extent of Structural and Dynamic Modulation of Membrane Lipids due to Pore Forming Toxins: Insights from Molecular Dynamics Simulations

Soft Matter, 2020, Accepted Manuscript
DOI: 10.1039/D0SM00086H, Paper
Vadhana Varadarajan, Rajat Desikan, Ganapathy Ayappa
Infections in many virulent bacterial strains are triggered by the release of pore forming toxins (PFTs), which form oligomeric transmembrane pore complexes on the target plasma membrane. The spatial extent...
The content of this RSS Feed (c) The Royal Society of Chemistry




ex

Investigating the Role of Carbon Nanotubes (CNTs) in Piezoelectric Performance of PVDF/KNN based Flexible Electrospun Nanogenerator

Soft Matter, 2020, Accepted Manuscript
DOI: 10.1039/D0SM00438C, Paper
Satyaranjan Bairagi, Wazed Ali
In the present study, the effect of varying concentrations of carbon nanotube (CNT) on the piezoelectric performance of poly (vinylidene fluoride) (PVDF)/potassium sodium niobate (KNN) based electrospun nanocomposite has been...
The content of this RSS Feed (c) The Royal Society of Chemistry




ex

On the pressure dependence of the thermodynamical scaling exponent γ

Soft Matter, 2020, Advance Article
DOI: 10.1039/D0SM00254B, Paper
R. Casalini, T. C. Ransom
In materials with a constant scaling parameter γS, the Isomorph γI is found to vary with pressure, demonstrating γSγI.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




ex

Effects of Eigen and Actual Frequencies of Soft Elastic Surfaces on droplet Rebound from Stationary Flexible Feather Vanes

Soft Matter, 2020, Accepted Manuscript
DOI: 10.1039/D0SM00315H, Paper
Chengchun Zhang, Zhengyang Wu, Chun Shen, Yihua Zheng, LIANG YANG, Yan Liu, Luquan Ren
The aim of this paper is to investigate the effect of eigenfrequency and the actual frequency of the elastic surface for the droplet rebound. The elastic surface used in this...
The content of this RSS Feed (c) The Royal Society of Chemistry




ex

Experimental observation of boundary-driven oscillations in a reaction–diffusion–advection system

Soft Matter, 2020, 16,4243-4255
DOI: 10.1039/C9SM02291K, Paper
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Torsten Eckstein, Estefania Vidal-Henriquez, Azam Gholami
Boundary-driven oscillations are observed experimentally in a reaction-diffusion-advection system, namely in the signaling population of Dictyostelium discoideum cells.
The content of this RSS Feed (c) The Royal Society of Chemistry




ex

The tripeptide GHG as an unexpected hydrogelator triggered by imidazole deprotonation

Soft Matter, 2020, 16,4110-4114
DOI: 10.1039/D0SM00224K, Communication
Morgan Hesser, Lavenia Thursch, Todd Lewis, David DiGuiseppi, Nicolas J. Alvarez, Reinhard Schweitzer-Stenner
The tripeptide glycyl-histidyl-glycine (GHG) self-assembles into long, crystalline fibrils forming a strong hydrogel (G' ∼ 50 kPa) above a critical concentration of 40 mM upon the deprotonation of its imidazole group.
The content of this RSS Feed (c) The Royal Society of Chemistry




ex

Active noise experienced by a passive particle trapped in an active bath

Soft Matter, 2020, Advance Article
DOI: 10.1039/D0SM00006J, Paper
Simin Ye, Peng Liu, Fangfu Ye, Ke Chen, Mingcheng Yang
We study the properties of active noise experienced by a passive particle harmonically trapped in an active bath. The active noise is shown to depend on the trap stiffness.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




ex

Correlation of Hierarchical Structure and Rheological Behavior of Polypseudorotaxane Gel Composed of Pluronic and β-cyclodextrin

Soft Matter, 2020, Accepted Manuscript
DOI: 10.1039/D0SM00406E, Paper
kuo-chih Shih, Chien-You Su, Shing-Yun Chang, Grethe V Jensen, Chi-Chung Hua, Mu-Ping Nieh, Hsi-Mei Lai
We have identified the hierarchical (primary, secondary, tertiary and quaternary) structures of a polypseudorotaxane (PPR) gel composed of Pluronic F108 and β-cyclodextrin system to be β-cyclodextrin crystalline, lamellar sheets, lamellar...
The content of this RSS Feed (c) The Royal Society of Chemistry




ex

Single chain in mean field simulation of flexible and semiflexible polymers: Comparison with discrete chain self-consistent field theory

Soft Matter, 2020, Accepted Manuscript
DOI: 10.1039/D0SM00620C, Paper
So Jung Park, Jaeup Kim
Single chain in mean field (SCMF) simulation is a theoretical framework performing Monte Carlo moves of explicit polymer chains under quasi-instantaneously updated external fields which were originally imported from the...
The content of this RSS Feed (c) The Royal Society of Chemistry




ex

Sand lorry owners seek exemption from quarterly tax payment

Most lorries were not operated during the lockdown which resulted in loss, they say




ex

Tapping expertise — how T.N. is handling the crisis

Multiple panels with senior bureaucrats constituted to address issues arising out of the pandemic




ex

Explain methodology for issuing e-passes: HC

The Madras High Court on Friday called for a report from the State government explaining the methodology adopted by it for issuing e-passes for the tr




ex

[ASAP] Describing Meta-Atoms Using the Exact Higher-Order Polarizability Tensors

ACS Photonics
DOI: 10.1021/acsphotonics.9b01776




ex

[ASAP] Plasmon-Mediated Coherent Superposition of Discrete Excitons under Strong Exciton–Plasmon Coupling in Few-Layer MoS<sub>2</sub> at Room Temperature

ACS Photonics
DOI: 10.1021/acsphotonics.0c00233




ex

[ASAP] Modulation of the Visible Absorption and Reflection Profiles of ITO Nanocrystal Thin Films by Plasmon Excitation

ACS Photonics
DOI: 10.1021/acsphotonics.9b01825




ex

[ASAP] Exciton-Polaritons with Magnetic and Electric Character in All-Dielectric Metasurfaces

ACS Photonics
DOI: 10.1021/acsphotonics.0c00063




ex

[ASAP] Strain-Correlated Localized Exciton Energy in Atomically Thin Semiconductors

ACS Photonics
DOI: 10.1021/acsphotonics.0c00626




ex

Beautiful Scrolling Experiences – Without Libraries

Michelle Barker appears as one of a heavenly host, coming forth with scroll in hand to pronounce an end to janky scrolljacking! Unto us a new specification is born, in the city of TimBL, and its name shall be called Scroll Snap.


Sponsor: Order any Standard paperback(s) and get a surprise gift card in the box for YOU. While supplies last, from your pals at A Book Apart!


One area where the web has traditionally lagged behind native platforms is the perceived “slickness” of the app experience. In part, this perception comes from the way the UI responds to user interactions – including the act of scrolling through content.

Faced with the limitations of the web platform, developers frequently reach for JavaScript libraries and frameworks to alter the experience of scrolling a web page – sometimes called “scroll-jacking” – not always a good thing if implemented without due consideration of the user experience. More libraries can also lead to page bloat, and drag down a site’s performance. But with the relatively new CSS Scroll Snap specification, we have the ability to control the scrolling behaviour of a web page (to a degree) using web standards – without resorting to heavy libraries. Let’s take a look at how.

Scroll Snap

A user can control the scroll position of a web page in a number of ways, such as using a mouse, touch gesture or arrow keys. In contrast to a linear scrolling experience, where the rate of scroll reflects the rate of the controller, the Scroll Snap specification enables a web page to snap to specific points as the user scrolls. For this, we need a fixed-height element to act as the scroll container, and the direct children of that element will determine the snap points. To demonstrate this, here is some example HTML, which consists of a <div> containing four <section> elements:

<div class="scroll-container">
  <section>
    <h2>Section 1</h2>
  </section>
  <section>
    <h2>Section 2</h2>
  </section>
  <section>
    <h2>Section 3</h2>
  </section>
  <section>
    <h2>Section 4</h2>
  </section>
</div>

Scroll snapping requires the presence of two main CSS properties: scroll-snap-type and scroll-snap-align. scroll-snap-type applies to the scroll container element, and takes two keyword values. It tells the browser:

  • The direction to snap
  • Whether snapping is mandatory

scroll-snap-align is applied to the child elements – in this case our <section>s.

We also need to set a fixed height on the scroll container, and set the relevant overflow property to scroll.

.scroll-container {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}

section {
  height: 100vh;
  scroll-snap-align: center;
}

In the above example, I’m setting the direction in the scroll-snap-type property to y to specify vertical snapping. The second value specifies that snapping is mandatory. This means that when the user stops scrolling their scroll position will always snap to the nearest snap point. The alternative value is proximity, which determines that the user’s scroll position will be snapped only if they stop scrolling in the proximity of a snap point. (It’s down to the browser to determine what it considers to be the proximity threshold.)

If you have content of indeterminate length, which might feasibly be larger than the height of the scroll container (in this case 100vh), then using a value of mandatory can cause some content to be hidden above or below the visible area, so is not recommended. But if you know that your content will always fit within the viewport, then mandatory can produce a more consistent user experience.

See the Pen Simple scroll-snap example by Michelle Barker (@michellebarker) on CodePen.

In this example I’m setting both the scroll container and each of the sections to a height of 100vh, which affects the scroll experience of the entire web page. But scroll snapping can also be implemented on smaller components too. Setting scroll snapping on the x-axis (or inline axis) can produce something like a carousel effect.

In this demo, you can scroll horizontally scroll through the sections:

See the Pen Carousel-style scroll-snap example by Michelle Barker (@michellebarker) on CodePen.

The Intersection Observer API

By implementing the CSS above, our web page already has a more native-like feel to it. To improve upon this further we could add some scroll-based transitions and animations. We’ll need to employ a bit of Javascript for this, using the Intersection Observer API. This allows us to create an observer that watches for elements intersecting with the viewport, triggering a callback function when this occurs. It is more efficient than libraries that rely on continuously listening for scroll events.

We can create an observer that watches for each of our scroll sections coming in and out of view:

const sections = [...document.querySelectorAll('section')]

const options = {
  rootMargin: '0px',
  threshold: 0.25
}

const callback = (entries) => {
  entries.forEach((entry) => {
    if (entry.intersectionRatio >= 0.25) {
      target.classList.add("is-visible");
    } else {
      target.classList.remove("is-visible");
    }
  })
}

const observer = new IntersectionObserver(callback, options)

sections.forEach((section, index) => {
  observer.observe(section)
})

In this example, a callback function is triggered whenever one of our sections intersects the container by 25% (using the threshold option). The callback adds a class of is-visible to the section if it is at least 25% in view when the intersection occurs (which will take effect when the element is coming into view), and removes it otherwise (when the element is moving out of view). Then we can add some CSS to transition in the content for each of those sections:

section .content {
  opacity: 0:
}

section.is-visible .content {
  opacity: 1;
  transition: opacity 1000ms:
}

This demo shows it in action:

See the Pen Scrolling with Intersection Observer by Michelle Barker (@michellebarker) on CodePen.

You could, of course, implement some much more fancy transition and animation effects in CSS or JS!

As an aside, it’s worth pointing out that, in practice, we shouldn’t be setting opacity: 0 as the default without considering the experience if JavaScript fails to load. In this case, the user would see no content at all! There are different ways to handle this: We could add a .no-js class to the body (which we remove on load with JS), and set default styles on it, or we could set the initial style (before transition) with JS instead of CSS.

Position: sticky

There’s one more CSS property that I think has the potential to aid the scroll experience, and that’s the position property. Unlike position: fixed, which locks the position of an element relative to the nearest relative ancestor and doesn’t change, position: sticky is more like a temporary lock. An element with a position value of sticky will become fixed only until it reaches the threshold of its parent, at which point it resumes relative positioning.

By “sticking” some elements within scroll sections we can give the impression of them being tied to the action of scrolling between sections. It’s pretty cool that we can instruct an element to respond to it’s position within a container with CSS alone!

Browser support and fallbacks

The scroll-snap-type and scroll-snap-align properties are fairly well-supported. The former requires a prefix for Edge and IE, and older versions of Safari do not support axis values. In newer versions of Safari it works quite well. Intersection Observer similarly has a good level of support, with the exception of IE.

By wrapping our scroll-related code in a feature query we can provide a regular scrolling experience as a fallback for users of older browsers, where accessing the content is most important. Browsers that do not support scroll-snap-type with an axis value would simply scroll as normal.

@supports (scroll-snap-type: y mandatory) {
  .scroll-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
  }

  section {
    height: 100vh;
    scroll-snap-align: center;
  }
}

The above code would exclude MS Edge and IE, as they don’t support axis values. If you wanted to support them you could do so using a vendor prefix, and using @supports (scroll-snap-type: mandatory) instead.

Putting it all together

This demo combines all three of the effects discussed in this article.

Summary

Spending time on scroll-based styling might seem silly or frivolous to some. But I believe it’s an important part of positioning the web as a viable alternative to native applications, keeping it open and accessible. While these new CSS features don’t offer all of the control we might expect with a fully featured JS library, they have a major advantage: simplicity and reliability. By utilising web standards where possible, we can have the best of both worlds: Slick and eye-catching sites that satisfy clients’ expectations, with the added benefit of better performance for users.


About the author

Michelle is a Lead Front End Developer at Bristol web agency Atomic Smash, author of front-end blog CSS { In Real Life }, and a Mozilla Tech Speaker. She has written articles for CSS Tricks, Smashing Magazine, and Web Designer Magazine, to name a few. She enjoys experimenting with new CSS features and helping others learn about them.

More articles by Michelle




ex

It All Starts with a Humble <textarea>

Andy Bell rings out a fresh call in support of the timeless concept of progressive enhancement. What does it mean to build a modern JavaScript-focussed web experience that still works well if part of the stack isn’t supported or fails? Andy shows us how that might be done.


Those that know me well know that I make a lot of side projects. I most definitely make too many, but there’s one really useful thing about making lots of side projects: it allows me to experiment in a low-risk setting.

Side projects also allow me to accidentally create a context where I can demonstrate a really affective, long-running methodology for building on the web: progressive enhancement. That context is a little Progressive Web App that I’m tinkering with called Jotter. It’s incredibly simple, but under the hood, there’s a really solid experience built on top of a minimum viable experience which after reading this article, you’ll hopefully apply this methodology to your own work.

What is a minimum viable experience?

The key to progressive enhancement is distilling the user experience to its lowest possible technical solution and then building on it to improve the user experience. In the context of Jotter, that is a humble <textarea> element. That humble <textarea> is our minimum viable experience.

Let me show you how it’s built up, progressively real quick. If you disable CSS and JavaScript, you get this:

This result is great because I know that regardless of what happens, the user can do what they needed to do when the loaded Jotter in their browser: take some notes. That’s our minimum viable experience, completed with a few lines of code that work in every single browser—even very old browsers. Don’t you just love good ol’ HTML?

Now it’s time to enhance that minimum viable experience, progressively. It’s a good idea to do that in smaller steps rather than just provide a 0% experience or a 100% experience, which is the approach that’s often favoured by JavaScript framework enthusiasts. I think that process is counter-intuitive to the web, though, so building up from a minimum viable experience is the optimal way to go, in my opinion.

Understanding how a minimum viable experience works can be a bit tough, admittedly, so I like to use a the following diagram to explain the process:

Let me break down this diagram for both folks who can and can’t see it. On the top row, there’s four stages of a broken-up car, starting with just a wheel, all the way up to a fully functioning car. The car enhances only in a way that it is still mostly useless until it gets to its final form when the person is finally happy.

On the second row, instead of building a car, we start with a skateboard which immediately does the job of getting the person from point A to point B. This enhances to a Micro Scooter and then to a Push Bike. Its final form is a fancy looking Motor Scooter. I choose that instead of a car deliberately because generally, when you progressively enhance a project, it turns out to be way simpler and lighter than a project that was built without progressive enhancement in mind.

Now that we know what a minimum viable experience is and how it works, let’s apply this methodology to Jotter!

Add some CSS

The first enhancement is CSS. Jotter has a very simple design, which is mostly a full height <textarea> with a little sidebar. A flexbox-based, auto-stacking layout, inspired by a layout called The Sidebar is used and we’re good to go.

Based on the diagram from earlier, we can comfortably say we’re in Skateboard territory now.

Add some JavaScript

We’ve got styles now, so let’s enhance the experience again. A user can currently load up the site and take notes. If the CSS loads, it’ll be a more pleasant experience, but if they refresh their browser, they’re going to lose all of their work.

We can fix that by adding some local storage into the mix.

The functionality flow is pretty straightforward. As a user inputs content, the JavaScript listens to an input event and pushes the content of the <textarea> into localStorage. If we then set that localStorage data to populate the <textarea> on load, that user’s experience is suddenly enhanced because they can’t lose their work by accidentally refreshing.

The JavaScript is incredibly light, too:

const textArea = document.querySelector('textarea');
const storageKey = 'text';

const init = () => {

  textArea.value = localStorage.getItem(storageKey);

  textArea.addEventListener('input', () => {
    localStorage.setItem(storageKey, textArea.value);
  });
}

init();

In around 13 lines of code (which you can see a working demo here), we’ve been able to enhance the user’s experience considerably, and if we think back to our diagram from earlier, we are very much in Micro Scooter territory now.

Making it a PWA

We’re in really good shape now, so let’s turn Jotter into a Motor Scooter and make this thing work offline as an installable Progressive Web App (PWA).

Making a PWA is really achievable and Google have even produced a handy checklist to help you get going. You can also get guidance from a Lighthouse audit.

For this little app, all we need is a manifest and a Service Worker to cache assets and serve them offline for us if needed.

The Service Worker is actually pretty slim, so here it is in its entirety:

const VERSION = '0.1.3';
const CACHE_KEYS = {
  MAIN: `main-${VERSION}`
};

// URLS that we want to be cached when the worker is installed
const PRE_CACHE_URLS = ['/', '/css/global.css', '/js/app.js', '/js/components/content.js'];

/**
 * Takes an array of strings and puts them in a named cache store
 *
 * @param {String} cacheName
 * @param {Array} items=[]
 */
const addItemsToCache = function(cacheName, items = []) {
  caches.open(cacheName).then(cache => cache.addAll(items));
};

self.addEventListener('install', evt => {
  self.skipWaiting();

  addItemsToCache(CACHE_KEYS.MAIN, PRE_CACHE_URLS);
});

self.addEventListener('activate', evt => {
  // Look for any old caches that don't match our set and clear them out
  evt.waitUntil(
    caches
      .keys()
      .then(cacheNames => {
        return cacheNames.filter(item => !Object.values(CACHE_KEYS).includes(item));
      })
      .then(itemsToDelete => {
        return Promise.all(
          itemsToDelete.map(item => {
            return caches.delete(item);
          })
        );
      })
      .then(() => self.clients.claim())
  );
});

self.addEventListener('fetch', evt => {
  evt.respondWith(
    caches.match(evt.request).then(cachedResponse => {
      // Item found in cache so return
      if (cachedResponse) {
        return cachedResponse;
      }

      // Nothing found so load up the request from the network
      return caches.open(CACHE_KEYS.MAIN).then(cache => {
        return fetch(evt.request)
          .then(response => {
            // Put the new response in cache and return it
            return cache.put(evt.request, response.clone()).then(() => {
              return response;
            });
          })
          .catch(ex => {
            return;
          });
      });
    })
  );
});

What the Service Worker does here is pre-cache our core assets that we define in PRE_CACHE_URLS. Then, for each fetch event which is called per request, it’ll try to fulfil the request from cache first. If it can’t do that, it’ll load the remote request for us. With this setup, we achieve two things:

  1. We get offline support because we stick our critical assets in cache immediately so they will be accessible offline
  2. Once those critical assets and any other requested assets are cached, the app will run faster by default

Importantly now, because we have a manifest, some shortcut icons and a Service Worker that gives us offline support, we have a fully installable PWA!

Wrapping up

I hope with this simplified example you can see how approaching web design and development with a progressive enhancement approach, everyone gets an acceptable experience instead of those who are lucky enough to get every aspect of the page at the right time.

Jotter is very much live and in the process of being enhanced further, which you can see on its little in-app roadmap, so go ahead and play around with it.

Before you know it, it’ll be a car itself, but remember: it’ll always start as a humble little <textarea>.


About the author

Andy Bell is an independent designer and front-end developer who’s trying to make everyone’s experience on the web better with a focus on progressive enhancement and accessibility.

More articles by Andy




ex

Flexible Captioned Slanted Images

Eric Meyer gift wraps the most awkwardly shaped of boxes using nothing but CSS, HTML and a little curl of ribbon. No matter how well you plan and how much paper you have at your disposal, sometimes you just need to slant the gift to the side.


We have a lot of new layout tools at our disposal these days—flexbox is finally stable and interoperable, and Grid very much the same, with both technologies having well over 90% support coverage. In that light, we might think there’s no place for old tricks like negative margins, but I recently discovered otherwise.

Over at An Event Apart, we’ve been updating some of our landing pages, and our designer thought it would be interesting to have slanted images of speakers at the tops of pages. The end result looks like this.

The interesting part is the images. I wanted to set up a structure like the following, so that it will be easy to change speakers from time to time while preserving accessible content structures:

<div id="page-top">
  <ul class="monoliths">
    <li>
      <a href="https://aneventapart.com/speakers/rachel-andrew"> 
        <img src="/img/rachel-andrew.jpg" alt=""> 
        <div> 
          <strong>Rachel Andrew</strong> CSS Grid 
        </div> 
      </a>
    </li>
    <li>
      <a href="https://aneventapart.com/speakers/derek-featherstone"> 
        <img src="/img/derek-featherstone.jpg" alt=""> 
        <div> 
          <strong>Derek Featherstone</strong> Accessibility 
        </div> 
      </a>
    </li>
    <li>
      …
    </li>
    <li>
      …
    </li>
  </ul>
</div>

The id value for the div is straightforward enough, and I called the ul element monoliths because it reminded me of the memorial monoliths at the entrance to EPCOT in Florida. I’m also taking advantage of the now-ubiquitous ability to wrap multiple elements, including block elements, in a hyperlink. That way I can shove the image and text structures in there, and make the entire image and text below it one link.

Structure is easy, though. Can we make that layout fully responsive? I wondered. Yes we can. Here’s the target layout, stripped of the navbar and promo copy.

So let’s start from the beginning. The div gets some color and text styling, and the monoliths list is set to flex. The images are in a single line, after all, and I want them to be flexible for responsive reasons, so flexbox is 100% the right tool for this particular job.

#page-top { 
  background: #000; 
  color: #FFF; 
  line-height: 1; 
} 
#page-top .monoliths { 
  display: flex; 
  padding-bottom: 1em; 
  overflow: hidden; 
}

I also figured, let’s give the images a simple basis for sizing, and set up the hyperlink while we’re at it.

#page-top .monoliths li { 
  width: 25%; 
} 
#page-top .monoliths a { 
  color: inherit; 
  text-decoration: inherit; 
  display: block; 
  padding: 1px; 
}

So now the list items are 25% wide—I can say that because I know there will be four of them—and the links pick up the foreground color from their parent element. They’re also set to generate a block box.

At this point, I could concentrate on the images. They need to be as wide as their parent element, but no wider, and also match height. While I was at it, I figured I’d create a little bit of space above and below the captioning text, and make the strong elements containing speakers’ names generate a block box.

#page-top .monoliths img { 
  display: block; 
  height: 33rem; 
  width: 100%; 
} 
#page-top .monoliths div { 
  padding: 0.5em 0; 
} 
#page-top .monoliths strong { 
  display: block; 
  font-weight: 900; 
}

It looks like the speakers were all cast into the Phantom Zone or something, so that needs to be fixed. I can’t physically crop the images to be the “correct” size, because there is no correct size: this needs to work across all screen widths. So rather than try to swap carefully-sized images in and out at various breakpoints, or complicate the structure with a wrapper element set to suppress overflow of resized images, I turned to object-fit.

#page-top .monoliths img { 
  display: block; 
  height: 33rem; 
  width: 100%; 
  object-fit: cover; 
  object-position: 50% 20%; 
}

If you’ve never used object-fit, it’s a bit like background-size. You can use it to resize image content within the image’s element box without creating distortions. Here, I set the fit sizing to cover, which means all of the img element’s element box will be covered by image content. In this case, it’s like zooming in on the image content. I also set a zooming origin with object-position, figuring that 50% across and 20% down would be in the vicinity of a speaker’s face, given the way pictures of people are usually taken.

This is fairly presentable as-is—a little basic, perhaps, but it would be fine to layer the navbar and promo copy back over it with Grid or whatever, and call it a day. But it’s too square and boxy. We must go further!

To make that happen, I’m going to take out the third and fourth images temporarily, so we can see more clearly how the next part works. That will leave us with Rachel and Derek.

The idea here is to clip the images to be slanted, and then pull them close to each other so they have just a little space between them. The first part is managed with clip-path, but we don’t want to pull the images together unless their shapes are being clipped. So we set up a feature query.

@supports (clip-path: polygon(0 0)) or (-webkit-clip-path: polygon(0 0)) { 
  #page-top .monoliths li { 
    width: 37.5%; 
  } 
}

I decided to test for both the un-prefixed and WebKit-prefixed versions of clip-path because Safari still requires the prefix, and I couldn’t think of a good reason to penalize Safari’s users for the slowness of its standards advancement. Then I made the images wider, taking them from 25% to 37.5%, which makes them half again as wide.

Thanks to object fitting, the images don’t distort when I change their parent’s width; they just get wider and scale up the contents to fit. And now, it is time for clipping!

@supports (clip-path: polygon(0 0)) or (-webkit-clip-path: polygon(0 0)) { 
  #page-top .monoliths li { 
    width: 37.5%; 
    -webkit-clip-path: polygon(25% 0, 100% 0, 75% 100%, 0 100%); 
    clip-path: polygon(25% 0, 100% 0, 75% 100%, 0 100%); 
  } 
}

Each coordinate pair in the polygon() is like the position pairs in background-position or object-position: the horizontal distance first, followed by the vertical distance. So the first point in the polygon is 25% 0, which is 25% of the way across the element box, and no distance down, so right at the top edge. 100% 0 is the top right corner. 75% 100% is on the bottom edge, three-quarters of the way across the element, and 0 100% is the bottom left corner. That creates a polygon that’s a strip three-quarters the full width of the element box, and runs from bottom left to top right.

Now we just have to pull them together, and this is where old tricks come back into play: all we need is a negative right margin to bring them closer together.

#page-top .monoliths li { 
  width: 37.5%; 
  margin-right: -7.5%; 
  -webkit-clip-path: polygon(25% 0, 100% 0, 75% 100%, 0 100%); 
  clip-path: polygon(25% 0, 100% 0, 75% 100%, 0 100%); 
}

The separation between them is a little wider than we were originally aiming for, but let’s see what happens when we add the other two images back in and let flexbox do its resizing magic.

Notice how the slants actually change shape as the screen gets narrower or wider. This is because they’re still three-quarters the width of the image element’s box, but the width of that box is changing as the screen width changes. That means at narrow widths, the slant is much steeper, whereas at wide widths, the slant is more shallow. But since the clipping path’s coordinates were all set with percentage distances, they all stay parallel to each other while being completely responsive to changes in screen size. An absolute measure like pixels would have failed.

But how did the images get closer together just by adding in two more? Because the list items’ basic sizing added up to more than 100%, and they’re all set to flex-shrink: 1. No, you didn’t miss a line in the CSS: 1 is the default value for flex-shrink. Flex items will shrink by default, which after all is what we should expect from a flexible element. If you want to know how much they shrunk, and why, here’s what Firefox’s flex inspector reports.

When there were only two list items, there was space enough for both to be at their base size, with no shrinkage. Once we went to four list items, there wasn’t enough space, so they all shrank down. At that point, having a negative right margin of -7.5% was just right to pull them together to act as a unit.

So, now they’re all nicely nestled together, and fully responsive! The captions need a little work, though. Notice how they’re clipped off a bit on the left edge, and can be very much clipped off on the right side at narrower screen widths? This happens because the li elements are being clipped, and that clipping applies to all their contents, images and text alike. And we can’t use overflow to alter this: clipped is clipped, not overflowed.

Fortunately, all we really need to do is push the text over a small amount. Inside the feature query, I added:

#page-top .monoliths div { 
  padding-left: 2%;
  padding-right: 26%; 
}

This shifts the text just a bit rightward, enough to clear the clip path. On the right side, I padded the div boxes so their contents wouldn’t fall outside the clipped area and appear to slide under the next caption. We could also use margins here, but I didn’t for reasons I’ll make clear at the end.

At the last minute, I decided to make the text at least appear to follow the slants of the images. For that, I just needed to shift the first line over a bit, which I did with a bit more padding.

#page-top .monoliths strong { 
  padding-left: 1%; 
}

That’s all to the good, but you may have noticed the captions still overlap at really narrow screen widths. There are a lot of options here, from stacking the images atop one another to reverting to normal flow, but I decided to just hide the captions if things got too narrow. It reduces clutter without sacrificing too much in the way of content, and by leaving them still technically visible, they seem to remain accessible.

@media (max-width: 35rem) { 
  #page-top .monoliths div { 
    opacity: 0.01 
  } 
}

And that, as they say, is that! Fully responsive slanted images with text, in an accessible markup structure. I dig it.

I did fiddle around with the separations a bit, and found that a nice thin separator occurred around margin-right: -8%, whereas beefier ones could be found above -7%. And if you crank the negative margin value to something beyond -8%, you’ll make the images overlap entirely, no visible separation—which can be a useful effect in its own right.

I promised to say why I used padding for the caption text div rather than margins. Here’s why.

#page-top .monoliths div { 
  padding-left: 3%; 
  padding-right: 26%; 
  border-top: 2px solid transparent; 
  background: linear-gradient(100deg,hsl(292deg,50%,50%) 50%, transparent 85%); 
  background-clip: padding-box; 
}

It required a wee bit more padding on the left to look decent, and an alteration to the background clipping box in order to keep the purple from filling the transparent border area, but the end result is pretty nifty, if I do say so myself. Alternatively, we could drop the background gradient on the captions and put one in the background, with a result like this.

I have no doubt this technique could be extended, made more powerful, and generally improved upon. I really wished for subgrid support in Chrome, so that I could put everything on a grid without having to tear the markup structure apart, and there are doubtless even more interesting clipping paths and layout patterns to try out.

I hope these few ideas spark some much better ideas in you, and that you’ll share them with us!


About the author

Eric A. Meyer (@meyerweb) has been a burger flipper, a college webmaster, an early blogger, one of the original CSS Samurai, a member of the CSS Working Group, a consultant and trainer, and a Standards Evangelist for Netscape. Among other things, Eric co-wrote Design For Real Life with Sara Wachter-Boettcher for A Book Apart and CSS: The Definitive Guide with Estelle Weyl for O’Reilly, created the first official W3C test suite, assisted in the creation of microformats, and co-founded An Event Apart with Jeffrey Zeldman. Eric lives with his family in Cleveland, Ohio, which is a much nicer city than you’ve probably heard. He enjoys a good meal whenever he can and considers almost every form of music to be worthwhile.

More articles by Eric




ex

Cigarette taxes and smoking among sexual minority adults [electronic resource] / Christopher Carpenter, Dario Sansone

Cambridge, Mass. : National Bureau of Economic Research, 2020




ex

Reluctant warriors: Germany, Japan, and their U.S. alliance dilemma / Alexandra Sakaki, Hanns W. Maull, Kerstin Lukner, Ellis S. Krauss, Thomas U. Berger

Dewey Library - UA710.S135 2020




ex

Extreme reactions: radical right mobilization in Eastern Europe / Lenka Bustikova, Arizona State University

Dewey Library - JC573.2.E852 B88 2020




ex

Territorial sovereignty: a philosophical exploration / Anna Stilz

Dewey Library - JC327.S79 2019




ex

The suspect: an Olympic bombing, the FBI, the media, and Richard Jewell, the man caught in the middle / Kent Alexander & Kevin Salwen

Dewey Library - HV8079.B62 A44 2019




ex

Cold War Exiles and the CIA: plotting to free Russia / Benjamin Tromly

Dewey Library - JK468.I6 T76 2019




ex

The end of European security institutions: the EU's common foreign and security policy and NATO after Brexit / Benjamin Zyla

Online Resource




ex

Exploring Patterns of Behaviour in Violent Jihadist Terrorists: an analysis of six significant terrorist conspiracies in the UK.

Online Resource




ex

Nationalism and the economy: explorations into a neglected relationship / edited by Stefan Berger and Thomas Fetzer

Dewey Library - JC311.N221234 2019




ex

Wartime sexual violence against men: masculinities and power in conflict zones / Élise Féron

Dewey Library - HV6558.F47 2018




ex

The gang paradox: inequalities and miracles on the U.S.-Mexico border / Robert J. Durán

Hayden Library - HV6439.M58 D87 2018




ex

Sexual and gender-based violence: a complete clinical guide / Veronica Ades, editor

Online Resource




ex

The sexual politics of gendered violence and women's citizenship / Suzanne Franzway, Nicole Moulding, Sarah Wendt, Carole Zufferey, Donna Chung

Dewey Library - HV6626.F73 2019




ex

Disarming Doomsday: the human impact of nuclear weapons since Hiroshima / Becky Alexis-Martin

Dewey Library - U263.A44 2019




ex

Exploring political legacies Stephen Farrall, Colin Hay, Emily Gray

Online Resource




ex

Plea in Supreme Court seeks waiver of fees for next semester

It says parents of university students are in no position to pay high fees because of heavy losses, zero income




ex

LSAT entrance exam to be held online due to COVID-19

US-based The Law School Admission Council (LSAC) has decided to administer the 2020 LSAT-India entrance examination online for the first time ever fr




ex

DA case: Jaganmohan Reddy's judicial custody extended till October 3

Court had earlier on Sept 18 reserved its order till Sept 23 on Jagan's bail plea.




ex

Ex Punjab DSP jailed for 35 years for abducting 7 persons

The five year sentence for abducting seven persons will run consequently, thus making it 35 years in jail.




ex

Proposal to extend airport metro to IFFCO Chowk, Gurgaon

Ministry has also told the Delhi metro that it should try and make the line viable by exploring other option.