Skip to content

Instantly share code, notes, and snippets.

View dbyzero's full-sized avatar
👨‍💻
coding

Cyril ALFARO dbyzero

👨‍💻
coding
View GitHub Profile
@sbp
sbp / OpenSans.css
Created August 1, 2011 13:11
CSS for Open Sans
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 400;
src: local('Open Sans Italic'), local('Open-Sans-Italic'),
url('OpenSans-Italic.woff') format('woff'),
url('OpenSans-Italic.ttf') format('truetype');
}
@font-face {
@paulirish
paulirish / what-forces-layout.md
Last active July 22, 2024 06:32
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent