Css shapes

OrChen 227 views 15 slides Sep 21, 2016
Slide 1
Slide 1 of 15
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15

About This Presentation

Css shapes is a new addition to the Css language which allows developers and designers wrap content around paths like, circles, ellipses and polygons.


Slide Content

Css Shapes Fashion the web

Think outside the box

Intro Css Shapes is a brand new addition to the css language which allows designers and developers to wrap content around paths. Shapes can be defined manually or they can be inferred from images. <img class = ”element” src = ”espresso.png” /> <p> Lorem ipsum… </p> <style> .element{ shape-outside: url( image.png ); shape-image-threshold: 0.5 ; float: left; } </style>

Create Shapes The css shapes specification defines four shape functions: Circle () Ellipse () Polygon () Inset() And three css attributes: Shape-margin Shape-outside Shape-image-threshold

Circle(R at Cx Cy) .element{ shape-outside: circle( 50 %); width: 300px ; height: 300px ; float : left; }

Ellipse(Rx Ry at Cx Cy) .element{ shape-outside: ellipse(closest-side farthest-side at 50 % 50 % ); shape-outside: ellipse( 150px 300px at 50 % 50 %); width: 300px ; height: 600px ; }

Polygon(X1, Y1, X2, Y2, ….) .element{ shape-outside: polygon( , 0 300px , 300px 600px ); width: 300px ; height: 600px ; }

Inset(Top Right Bottom Left Border-Radius) .element{ shape-outside: inset( 100px 100px 100px 100px ); float : left; }

Animate Shapes - Resizing Effect .element{ shape-outside: circle( 30 %); transition: shape-outside 1s ; float : left; } .element:hover{ shape-outside: circle( 50 %); }

Animate Shapes - Transformation Effect .element{ shape-outside: polygon( 0 0 , 100 % , 100 % 100 %, 0 100 %); transition: shape-outside 1s ; } .element:hover{ shape-outside: polygon( 0 0 , 100 % 50 %, 100 % 50 %, 0 100 %); }

Work with Shapes Css Shapes is still a newborn technology, thus currently only the major browsers support it. Stay tuned for upcoming supporting browsers here: http://caniuse.com/#feat=css-shapes Furthermore, here are some links that can help getting started with Shapes: CSS Shapes Editor extension for Google Chrome T utorial for Photoshop CSS Shapes polyfill

The Future of Css Shapes Shapes-Inside and Css Exclusion

“ There are three responses to a piece of design – yes, no, and WOW! Wow is the one to aim for. ” - Milton Glaser

In a web where content is mostly trapped in simple boxes, CSS Shapes provide a way to create expressive layout, bridging the fidelity gap between web and print design

Thanks! Contact me: [email protected] https://il.linkedin.com/in/orchen https://www.facebook.com/orchen.io