Slides for my talk at Kings of Code in Asterdam, 2012 about using CSS Regions and CSS Exclusions & Shapes as building blocks for digital publications layout.
c o l l e c t c o n t e n t i n t o a n a m e d f l o w * / f l o w - i n t o : m y F l o w ; } . r e g i o n { / * r e n d e r t h e c o n t e n t f r o m t h e n a m e d f l o w * / f l o w - f r o m : m y F l o w ; }
1 , a r t i c l e i m g , a r t i c l e p : n t h - c h i l d ( 1 ) { / * c o l l e c t c o n t e n t i n t o a n a m e d f l o w * / f l o w - i n t o : p r e v i e w ; } . r e g i o n { / * r e n d e r t h e c o n t e n t f r o m t h e n a m e d f l o w * / f l o w - f r o m : p r e v i e w ; }
e n t : s e m a n t i c m a r k u p - - > < a r t i c l e > < h 1 > T i t l e < / h 1 > < p > . . . < / p > < / a r t i c l e > < ! - - l a y o u t : h e l p e r m a r k u p - - > < d i v c l a s s = " r e g i o n " > < / d i v > < d i v c l a s s = " r e g i o n " > < / d i v > < d i v c l a s s = " r e g i o n " > < / d i v >
s = d o c u m e n t . g e t N a m e d F l o w s ( ) v a r f l o w = f l o w s [ ' m y F l o w ' ] / / G e t t h e n o d e s c o l l e c t e d i n t h e n a m e d f l o w f l o w . g e t C o n t e n t ( ) / / G e t t h e r e g i o n s t h a t r e n d e r t h e c o n t e n t f l o w . g e t R e g i o n s ( )
s = d o c u m e n t . g e t N a m e d F l o w s ( ) v a r f l o w = f l o w s [ ' m y F l o w ' ] / / { B o o l e a n } i s t h e r e m o r e c o n t e n t t h a n r e g i o n s ? f l o w . o v e r s e t / / A d d m o r e r e g i o n s i f n e c e s a r y f l o w . a d d E v e n t L i s t e n e r ( ' r e g i o n l a y o u t u p d a t e ' , f u n c t i o n ( ) { i f ( f l o w . o v e r s e t ) { / / a d d m o r e r e g i o n s } } )
{ / * . . . * / } # e x c l u s i o n { s h a p e - o u t s i d e : c i r c l e ( 5 0 p x , 5 0 p x 5 0 p x ) / * t e x t c o n t e n t g o e s a r o u n d b o t h m y s i d e s * / w r a p - f l o w : b o t h ; }
> < c i r c l e i d = " c i r c l e _ s h a p e " c x = " 5 0 % " c y = " 5 0 % " r = " 5 0 % " / > < / s v g > # c o n t e n t { s h a p e - i n s i d e : u r l ( # c i r c l e _ s h a p e ) }
e n t : s e m a n t i c m a r k u p - - > < a r t i c l e > < h 1 > T i t l e < / h 1 > < p > . . . < / p > < / a r t i c l e > < ! - - l a y o u t : h e l p e r m a r k u p - - > < d i v c l a s s = " r e g i o n " > < / d i v > < d i v c l a s s = " r e g i o n " > < / d i v > < d i v c l a s s = " r e g i o n " > < / d i v >
blog CSS Regions tutorial CSS Regions on html.adobe.com CSS Exclusions and Shapes CSS Exclusions and Shapes Proposal to W3C CSS Exclusions on html.adobe.com Hans Muller's blog Web Components Introduction to Web Components Web Components slides by Eric Bidelman