SlideShare una empresa de Scribd logo
1 de 104
Descargar para leer sin conexión
Link to Talk
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;
}
const sorted = sort([4, 2, 1, 3]);
.container {
display: flex;
}
// Flex wrap, maybe
// https://github.com/servo/servo/blob/master/components/layout/flex.rs
for item in items {
let kid = children.get(item.index);
item.init_sizes(kid, container_size, self.main_mode);
let outer_main_size = item.outer_main_size(kid, self.main_mode);
if self.is_wrappable && total_line_size + outer_main_size > container_s
break;
}
margin_count += item.auto_margin_count(kid, self.main_mode);
total_line_size += outer_main_size;
end += 1;
}
.hero {
  --height: 80vh;
--ratio: 1.42;
  display: grid;
  grid-template-rows: minmax(20px, 0.5fr) max-content minmax(100px, 1fr);
  grid-template-columns: 100vw;
  justify-items: center;
  height: var(--height);
  
  &__images {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: var(--height);
    min-width: 100%;
    width: calc( var(--height) * var(--ratio) );
  }
&__content {
z-index: 1;
grid-area: 2 / 1 / 2 / 1;
}
}
.hero {
  --height: 80vh;
--ratio: 1.42;
  display: grid;
  grid-template-rows: minmax(20px, 0.5fr) max-content minmax(100px, 1fr);
  grid-template-columns: 100vw;
  justify-items: center;
  height: var(--height);
  
  &__images {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: var(--height);
    min-width: 100%;
    width: calc( var(--height) * var(--ratio) );
  }
&__content {
z-index: 1;
grid-area: 2 / 1 / 2 / 1;
}
}
.hero {
  --height: 80vh;
--ratio: 1.42;
  display: grid;
  grid-template-rows: minmax(20px, 0.5fr) max-content minmax(100px, 1fr);
  grid-template-columns: 100vw;
  justify-items: center;
  height: var(--height);
  
  &__images {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: var(--height);
    min-width: 100%;
    width: calc( var(--height) * var(--ratio) );
  }
&__content {
z-index: 1;
grid-area: 2 / 1 / 2 / 1;
}
}
.clearfix::before,
.clearfix::after {
    content: "";
    display: table;
}
.clearfix::after {
    clear: both;
}
.outer-thing {
    position: relative;
}
.sticky-thing {
    position: absolute;
    bottom: 100%;
    left: 0;
}
.image-container {
    // position: relative;
    // padding-bottom: calc( (2 / 3) * 100% );
}
.image-container > img {
    // position: absolute;
    // width: 100%;
    // height: 100%;
    // object-fit: cover;
}
    
.image-container {
    position: relative;
    // padding-bottom: calc( (2 / 3) * 100% );
}
.image-container > img {
    position: absolute;
    width: 100%;
    height: 100%;
    // object-fit: cover;
}
.image-container {
    position: relative;
    padding-bottom: calc( (2 / 3) * 100% );
}
.image-container > img {
    position: absolute;
    width: 100%;
    height: 100%;
    // object-fit: cover;
}
    
.image-container {
    position: relative;
    padding-bottom: calc( (2 / 3) * 100% );
}
.image-container > img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
    
.arrow-up {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 15px solid red;
}
h1 {
    font-size: calc( 2rem + 3vw );
}
@media( min-width: 800px ) {
    h1 {
        font-size: calc( 2rem + ( 800px * ( 3 / 100 ) ) );
    }
}
// _mixins.scss
@mixin fluid-type( $base-font-size, $growth-factor, $stop-growing-at ) {
    --growth-factor: calc( #{$growth-factor} * 1vw );
    
    @media( min-width: $stop-growing-at ) {
        --growth-factor: calc( #{$stop-growing-at} * ( (#{$growth-factor} / 100) ) );
    }
    
    font-size: $base-font-size; // Fallback.
    font-size: calc( #{$base-font-size} + var(--growth-factor) );
}
// _typography.scss
.fluid-type-large {
    @include fluid-type( 1rem, 3, 800px );
}
https://codepen.io/laras126/pen/JeVRbo
div {
  counter-increment: fizzbuzz;
  
  &:after {
    content: counter(fizzbuzz);
  }
  
  &:nth-child(3n):before {
    content: 'Fizz';
  }
  
  &:nth-child(3n):after {
    content: '';
  }
  
  &:nth-child(5n):after {
    content: 'Buzz';
  }
}
.l-features {
    margin-bottom: rem-calc(20);
    @include supports-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-row-gap: rem-calc(20);
        grid-column-gap: rem-calc(30);
        @include breakpoint( desktop ) {
            grid-template-columns: 2fr minmax( #{rem-calc(150)}, 1fr );
        }
    }
}
.l-features__header {
    grid-column: 1 / -1;
}
$o_story_river_config = [
    'class' => 'o-story--two-col o-story--river u-padding-tb-20',
    'image_class' => 'u-bg-dots u-bg-dots--river',
    'title_class' => 'c-title--medium@tablet-min',
    'dek_class' => 'c-dek--medium@tablet-min',
];
PMC::render_template(
    sprintf( ‘%s/tmpl/inc/objects/o-story.php', IW_TEMPLATE_DIR ),
    [
        'article' => $post,
        'data' => $o_story_river_config,
    ],
    true
);
// In an npm package.
.u-glue-parent {
    position: relative;
}
.u-glue {
    --u-glue__transform: initial;    
    position: absolute;
}
[data-glue*="top"] {
    top: 0;
}
[data-glue*="right"] {
    right: 0;
}
[data-glue*="bottom"] {
    bottom: 0;  
https://codepen.io/laras126/pen/vVXrMz
<figure class="u-glue-parent o-block">
    <figcaption class="u-glue c-tag" data-glue="top right">Caption</figcaption>
    <img src="https://picsum.photos/350/200" alt="" />
</figure>
// In a project.
.c-tag {
    background-color: coral;
    padding: 0.5rem;
    color: white;
    border: 2px solid navy;
    
    --u-glue__transform: translate( 50%, 50% );
} https://codepen.io/laras126/pen/vVXrMz
// In PMC Core Patterns npm package.
@mixin pmc-u-crop( $width, $height ) {
    position: relative;
    padding-bottom: calc( ( #{$height} / #{$width} ) * 100% );
    img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}
$ratios: (
    (16, 9),
    (3, 2),
    (1, 1)
);
@each $ratio in $ratios {   
    $w: nth( $ratio, 1 );
    $h: nth( $ratio, 2 );
    
    .pmc-u-crop-#{$w}x#{$h} {
        @include pmc-u-crop( $width: $w, $height:$h );
    }
}
The Way We Talk About CSS by Rachel Andrew
The Way We Talk About CSS by Rachel Andrew
Bridging the Design to Development Gap with CSS Algorithms (Algorithms of CSS v2.0 @ WordCamp US)

Más contenido relacionado

La actualidad más candente

Sql server ___________session_20(ddl triggers)
Sql server  ___________session_20(ddl triggers)Sql server  ___________session_20(ddl triggers)
Sql server ___________session_20(ddl triggers)
Ehtisham Ali
 

La actualidad más candente (19)

Pandas Cheat Sheet
Pandas Cheat SheetPandas Cheat Sheet
Pandas Cheat Sheet
 
Om (Cont.)
Om (Cont.)Om (Cont.)
Om (Cont.)
 
imager package in R and examples..
imager package in R and examples..imager package in R and examples..
imager package in R and examples..
 
Currying in Swift
Currying in SwiftCurrying in Swift
Currying in Swift
 
Grestest2
Grestest2Grestest2
Grestest2
 
Cryptocurrency ecosystem(together society)
Cryptocurrency ecosystem(together society)Cryptocurrency ecosystem(together society)
Cryptocurrency ecosystem(together society)
 
ProgrammingwithGOLang
ProgrammingwithGOLangProgrammingwithGOLang
ProgrammingwithGOLang
 
Program to sort the n names in an alphabetical order
Program to sort the n names in an alphabetical orderProgram to sort the n names in an alphabetical order
Program to sort the n names in an alphabetical order
 
NCCU: Statistics in the Criminal Justice System, R basics and Simulation - Pr...
NCCU: Statistics in the Criminal Justice System, R basics and Simulation - Pr...NCCU: Statistics in the Criminal Justice System, R basics and Simulation - Pr...
NCCU: Statistics in the Criminal Justice System, R basics and Simulation - Pr...
 
Advanced Data Visualization Examples with R-Part II
Advanced Data Visualization Examples with R-Part IIAdvanced Data Visualization Examples with R-Part II
Advanced Data Visualization Examples with R-Part II
 
Pytorch and Machine Learning for the Math Impaired
Pytorch and Machine Learning for the Math ImpairedPytorch and Machine Learning for the Math Impaired
Pytorch and Machine Learning for the Math Impaired
 
Introduction to Processing
Introduction to ProcessingIntroduction to Processing
Introduction to Processing
 
Sql server ___________session_20(ddl triggers)
Sql server  ___________session_20(ddl triggers)Sql server  ___________session_20(ddl triggers)
Sql server ___________session_20(ddl triggers)
 
Ernst kuilder (Nelen & Schuurmans) - De waterkaart van Nederland: technisch g...
Ernst kuilder (Nelen & Schuurmans) - De waterkaart van Nederland: technisch g...Ernst kuilder (Nelen & Schuurmans) - De waterkaart van Nederland: technisch g...
Ernst kuilder (Nelen & Schuurmans) - De waterkaart van Nederland: technisch g...
 
Mosaic plot in R.
Mosaic plot in R.Mosaic plot in R.
Mosaic plot in R.
 
R scatter plots
R scatter plotsR scatter plots
R scatter plots
 
CLUSTERGRAM
CLUSTERGRAMCLUSTERGRAM
CLUSTERGRAM
 
Py lecture5 python plots
Py lecture5 python plotsPy lecture5 python plots
Py lecture5 python plots
 
Advanced Data Visualization in R- Somes Examples.
Advanced Data Visualization in R- Somes Examples.Advanced Data Visualization in R- Somes Examples.
Advanced Data Visualization in R- Somes Examples.
 

Similar a Bridging the Design to Development Gap with CSS Algorithms (Algorithms of CSS v2.0 @ WordCamp US)

Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)
Remy Sharp
 
Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02
PL dream
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
Varun C M
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 
Twig, the flexible, fast, and secure template language for PHP
Twig, the flexible, fast, and secure template language for PHPTwig, the flexible, fast, and secure template language for PHP
Twig, the flexible, fast, and secure template language for PHP
Fabien Potencier
 
Enhance Web Performance
Enhance Web PerformanceEnhance Web Performance
Enhance Web Performance
Adam Lu
 
Blog skins396734
Blog skins396734Blog skins396734
Blog skins396734
pantangmrny
 

Similar a Bridging the Design to Development Gap with CSS Algorithms (Algorithms of CSS v2.0 @ WordCamp US) (20)

CSS Algorithms v3.4 @ CSSCamp Barcelona
CSS Algorithms  v3.4 @ CSSCamp BarcelonaCSS Algorithms  v3.4 @ CSSCamp Barcelona
CSS Algorithms v3.4 @ CSSCamp Barcelona
 
Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)
 
Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02
 
CSS Algorithms - v3.6.1 @ Strange Loop
CSS Algorithms - v3.6.1 @ Strange LoopCSS Algorithms - v3.6.1 @ Strange Loop
CSS Algorithms - v3.6.1 @ Strange Loop
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
 
JQuery Flot
JQuery FlotJQuery Flot
JQuery Flot
 
Simple flat ui css accordion
Simple flat ui css accordionSimple flat ui css accordion
Simple flat ui css accordion
 
CSS3 Takes on the World
CSS3 Takes on the WorldCSS3 Takes on the World
CSS3 Takes on the World
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology update
 
jQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and PerformancejQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and Performance
 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 Workshop
 
The Ring programming language version 1.9 book - Part 54 of 210
The Ring programming language version 1.9 book - Part 54 of 210The Ring programming language version 1.9 book - Part 54 of 210
The Ring programming language version 1.9 book - Part 54 of 210
 
The Ring programming language version 1.5.2 book - Part 44 of 181
The Ring programming language version 1.5.2 book - Part 44 of 181The Ring programming language version 1.5.2 book - Part 44 of 181
The Ring programming language version 1.5.2 book - Part 44 of 181
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Twig Brief, Tips&Tricks
Twig Brief, Tips&TricksTwig Brief, Tips&Tricks
Twig Brief, Tips&Tricks
 
Twig, the flexible, fast, and secure template language for PHP
Twig, the flexible, fast, and secure template language for PHPTwig, the flexible, fast, and secure template language for PHP
Twig, the flexible, fast, and secure template language for PHP
 
Enhance Web Performance
Enhance Web PerformanceEnhance Web Performance
Enhance Web Performance
 
Blog skins396734
Blog skins396734Blog skins396734
Blog skins396734
 
A proper introduction to Elm
A proper introduction to ElmA proper introduction to Elm
A proper introduction to Elm
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Bridging the Design to Development Gap with CSS Algorithms (Algorithms of CSS v2.0 @ WordCamp US)

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. 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; } const sorted = sort([4, 2, 1, 3]);
  • 33.
  • 34.
  • 36.
  • 37. // Flex wrap, maybe // https://github.com/servo/servo/blob/master/components/layout/flex.rs for item in items { let kid = children.get(item.index); item.init_sizes(kid, container_size, self.main_mode); let outer_main_size = item.outer_main_size(kid, self.main_mode); if self.is_wrappable && total_line_size + outer_main_size > container_s break; } margin_count += item.auto_margin_count(kid, self.main_mode); total_line_size += outer_main_size; end += 1; }
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46. .hero {   --height: 80vh; --ratio: 1.42;   display: grid;   grid-template-rows: minmax(20px, 0.5fr) max-content minmax(100px, 1fr);   grid-template-columns: 100vw;   justify-items: center;   height: var(--height);      &__images {     display: flex;     flex-direction: column;     justify-content: flex-end;     height: var(--height);     min-width: 100%;     width: calc( var(--height) * var(--ratio) );   } &__content { z-index: 1; grid-area: 2 / 1 / 2 / 1; } }
  • 47. .hero {   --height: 80vh; --ratio: 1.42;   display: grid;   grid-template-rows: minmax(20px, 0.5fr) max-content minmax(100px, 1fr);   grid-template-columns: 100vw;   justify-items: center;   height: var(--height);      &__images {     display: flex;     flex-direction: column;     justify-content: flex-end;     height: var(--height);     min-width: 100%;     width: calc( var(--height) * var(--ratio) );   } &__content { z-index: 1; grid-area: 2 / 1 / 2 / 1; } }
  • 48.
  • 49.
  • 50.
  • 51.
  • 52. .hero {   --height: 80vh; --ratio: 1.42;   display: grid;   grid-template-rows: minmax(20px, 0.5fr) max-content minmax(100px, 1fr);   grid-template-columns: 100vw;   justify-items: center;   height: var(--height);      &__images {     display: flex;     flex-direction: column;     justify-content: flex-end;     height: var(--height);     min-width: 100%;     width: calc( var(--height) * var(--ratio) );   } &__content { z-index: 1; grid-area: 2 / 1 / 2 / 1; } }
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62. .clearfix::before, .clearfix::after {     content: "";     display: table; } .clearfix::after {     clear: both; }
  • 63. .outer-thing {     position: relative; } .sticky-thing {     position: absolute;     bottom: 100%;     left: 0; }
  • 64. .image-container {     // position: relative;     // padding-bottom: calc( (2 / 3) * 100% ); } .image-container > img {     // position: absolute;     // width: 100%;     // height: 100%;     // object-fit: cover; }     
  • 65. .image-container {     position: relative;     // padding-bottom: calc( (2 / 3) * 100% ); } .image-container > img {     position: absolute;     width: 100%;     height: 100%;     // object-fit: cover; }
  • 66. .image-container {     position: relative;     padding-bottom: calc( (2 / 3) * 100% ); } .image-container > img {     position: absolute;     width: 100%;     height: 100%;     // object-fit: cover; }     
  • 67. .image-container {     position: relative;     padding-bottom: calc( (2 / 3) * 100% ); } .image-container > img {     position: absolute;     width: 100%;     height: 100%;     object-fit: cover; }     
  • 68. .arrow-up {     width: 0;     height: 0;     border-left: 15px solid transparent;     border-right: 15px solid transparent;     border-bottom: 15px solid red; }
  • 69. h1 {     font-size: calc( 2rem + 3vw ); } @media( min-width: 800px ) {     h1 {         font-size: calc( 2rem + ( 800px * ( 3 / 100 ) ) );     } }
  • 70.
  • 71. // _mixins.scss @mixin fluid-type( $base-font-size, $growth-factor, $stop-growing-at ) {     --growth-factor: calc( #{$growth-factor} * 1vw );          @media( min-width: $stop-growing-at ) {         --growth-factor: calc( #{$stop-growing-at} * ( (#{$growth-factor} / 100) ) );     }          font-size: $base-font-size; // Fallback.     font-size: calc( #{$base-font-size} + var(--growth-factor) ); } // _typography.scss .fluid-type-large {     @include fluid-type( 1rem, 3, 800px ); } https://codepen.io/laras126/pen/JeVRbo
  • 72. div {   counter-increment: fizzbuzz;      &:after {     content: counter(fizzbuzz);   }      &:nth-child(3n):before {     content: 'Fizz';   }      &:nth-child(3n):after {     content: '';   }      &:nth-child(5n):after {     content: 'Buzz';   } }
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79. .l-features {     margin-bottom: rem-calc(20);     @include supports-grid {         display: grid;         grid-template-columns: 1fr;         grid-row-gap: rem-calc(20);         grid-column-gap: rem-calc(30);         @include breakpoint( desktop ) {             grid-template-columns: 2fr minmax( #{rem-calc(150)}, 1fr );         }     } } .l-features__header {     grid-column: 1 / -1; }
  • 80.
  • 81.
  • 82.
  • 83. $o_story_river_config = [     'class' => 'o-story--two-col o-story--river u-padding-tb-20',     'image_class' => 'u-bg-dots u-bg-dots--river',     'title_class' => 'c-title--medium@tablet-min',     'dek_class' => 'c-dek--medium@tablet-min', ]; PMC::render_template(     sprintf( ‘%s/tmpl/inc/objects/o-story.php', IW_TEMPLATE_DIR ),     [         'article' => $post,         'data' => $o_story_river_config,     ],     true );
  • 84. // In an npm package. .u-glue-parent {     position: relative; } .u-glue {     --u-glue__transform: initial;         position: absolute; } [data-glue*="top"] {     top: 0; } [data-glue*="right"] {     right: 0; } [data-glue*="bottom"] {     bottom: 0;   https://codepen.io/laras126/pen/vVXrMz
  • 85. <figure class="u-glue-parent o-block">     <figcaption class="u-glue c-tag" data-glue="top right">Caption</figcaption>     <img src="https://picsum.photos/350/200" alt="" /> </figure> // In a project. .c-tag {     background-color: coral;     padding: 0.5rem;     color: white;     border: 2px solid navy;          --u-glue__transform: translate( 50%, 50% ); } https://codepen.io/laras126/pen/vVXrMz
  • 86. // In PMC Core Patterns npm package. @mixin pmc-u-crop( $width, $height ) {     position: relative;     padding-bottom: calc( ( #{$height} / #{$width} ) * 100% );     img {         position: absolute;         width: 100%;         height: 100%;         object-fit: cover;     } }
  • 87. $ratios: (     (16, 9),     (3, 2),     (1, 1) ); @each $ratio in $ratios {        $w: nth( $ratio, 1 );     $h: nth( $ratio, 2 );          .pmc-u-crop-#{$w}x#{$h} {         @include pmc-u-crop( $width: $w, $height:$h );     } }
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 96.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101.
  • 102. The Way We Talk About CSS by Rachel Andrew
  • 103. The Way We Talk About CSS by Rachel Andrew