Más contenido relacionado
La actualidad más candente (20)
Similar a CSS Algorithms v3.4 @ CSSCamp Barcelona (20)
CSS Algorithms v3.4 @ CSSCamp Barcelona
- 10. What is A Programming Language? By Will Chrichton
- 54. function sort(array) {
for (let i = 0; i < array.length; i++) {
for (let ii = 0; ii < array.length; ii++) {
if (array[ii] > array[ii+1]) {
let temp = array[ii];
array[ii] = array[ii+1];
array[ii+1] = temp;
}
}
}
return array;
}
var sorted = sort([4, 2, 1, 3]);
- 71. h1 {
font-size: calc( 2rem + 3vw );
}
// Stops growing at 800px
@media( min-width: 800px ) {
h1 {
font-size: calc( 2rem + ( 800px * ( 3 / 100 ) ) );
}
}
- 84. .pmc-a-glue-parent {
position: relative;
}
.pmc-a-glue {
// Fallback is top left for everything.
top: 0;
left: 0;
position: absolute;
z-index: $z-index-middle-bottom;
top: var( --a-glue-top, initial );
bottom: var( --a-glue-bottom, initial );
right: var( --a-glue-right, initial );
left: var( --a-glue-left, initial );
}
.pmc-a-glue--r-0 {
--a-glue-right: 0;
}
.relative-parent {
position: relative;
}
.child
position: absolute;
right: 0;
bottom: 0;
}
- 86. .space-content > * + * {
margin-top: 1rem;
}
.a-space-children-horizontal {
display: flex;
flex-wrap: wrap;
}
.a-space-children-horizontal > * + * {
margin-left: $spacer-050; // Fallback.
margin-left: var( --a-space-children-spacer );
}
@supports( column-gap: 1rem ) {
.a-space-children-horizontal {
column-gap: var( --a-space-children-spacer );
}
.a-space-children-horizontal > * {
margin-bottom: unset;
- 124. describe( 'a-space-children-vertical', () => {
const parent = document.querySelector( '.a-space-children-vertical' );
const parentBox = parent.getBoundingClientRect();
it( 'does not apply a space above the first item', () => {
let kidBox = parent.children[0].getBoundingClientRect();
return assertEquals( parentBox.top, kidBox.top );
});
it( 'spaces children', () => {
let kid1Box = parent.children[0].getBoundingClientRect();
let kid2Box = parent.children[1].getBoundingClientRect();
let parentStyles = window.getComputedStyle( parent );
let spaceBetweenKids = parseInt( parentStyles.getPropertyValue( '--a-space-children-space
return assertEquals( kid1Box.bottom, ( kid2Box.top - spaceBetweenKids ) );
});
it( 'does not apply a space below the last item', () => {
let kidBox = children[ children.length - 1 ];