https://codepen.io/pedromsduarte/pen/BGypya
PEDRO M. S.
DUARTE
Digital designer and
UI developer
Visual designer
GRAPHIC DESIGNER
Digital designer
WEB DESIGNER
UI/UXer
PRODUCT DESIGNER
Frontend developer
UI DEVELOPER
CSS
LOVER
The var() function can be used to insert the value
of a custom property.
VARIABLES
CSS functions are used as a value for various CSS
properties.
CSS FUNCTIONS
#rrggbbaa the CSS Color Module Level 4 defines new
4 & 8 character hex notation for color to include the
opacity level.
COLOR VALUES
The background-blend-mode property defines the
blending mode of each background layer.
COMPOSITING AND BLENDING
clip-path creates a clipping region that sets what
part of an element should be shown.
CLIP PATHS
CSS Shapes describe geometric shapes for use in
CSS, causing wrapping lines to wrap round the
shape.
SHAPES
VariablesIt brings the power of variables to CSS, which
results in less repetition, better readability
and more flexibility.
--VAR()
Preprocessor
variables
STATIC
Preprocessors need to compile into 

CSS to be used
NOT AWARE OF THE DOM STRUCTURE
The variable is part of the preprocessor
language, not CSS itself.
DO NOT RUN IN BROWSER
The browser wouldn't understand the
declarations and toss them out.
Declaring a
global CSS
variable
To declare a variable, you first need to
decide which scope the variable
should live in. If you want it to be
available globally, simply define it on
the :root pseudo class.
:ROOT
Declaring a
local CSS
variable
You can also create local variables,
which are accessible only to the
element it’s declared at and to its
children.
<ELEMENT>
Using values
Each variable can be used for
calculation of other values, to create
even more dynamic values.
<ELEMENT>
Javascript
manipulation
Another advantage of living in the DOM
is that you can access the variables
with JavaScript, and even update them,
for example based upon used
interactions.
<ELEMENT>
https://codepen.io/pedromsduarte/pen/OaPLEY
You can use them without the need of a
preprocessor.
SUPPORT ON BROWSER
.01
You can set a variable inside any selector
to set or override its current value.
THEY CASCADE
.02
When their values change (e.g. media
query or other state), the browser
repaints as needed.
DYNAMIC VALUES
.03
You can access and manipulate them in
JavaScript.
JAVASCRIPT MANIPULATION
.04
W h y y o u s h o u l d u s e
SELECTORS
D o e s n o t w o r k
You can use them without the need of a
preprocessor.
SUPPORT ON BROWSER
.01
You can set a variable inside any selector
to set or override its current value.
THEY CASCADE
.02
When their values change (e.g. media
query or other state), the browser
repaints as needed.
DYNAMIC VALUES
.03
You can access and manipulate them in
JavaScript.
JAVASCRIPT MANIPULATION
.04
W h y y o u s h o u l d u s e
MEDIA QUERIES LINK VALUES
Color valuesCSS Color Module Level 4 introduces new
color spaces that will let us change how we
blend colors for the web.
#RRGGBBAA
4-8 digit hex
notation
#rrggbbaa notation works much the
same way as #rrggbb notation, but
with the addition of an alpha channel.
Here too, accepted values range
from 00–ff.
#rgba the additional alpha channel
value also applies to the shortened
hexadecimal form. 
#RGBA
#RRGGBBAA
#rrggbbaa
Colors will be very quick to write
especially with the #rgba shorthand.
QUICK TO WRITE
.01
Colors are identifiable at the first glance
because of a consistent notation followed
everywhere.
EASY IDENTIFICATION
.02
No switching between hex notation to
rgba() while working with translucent
colors thus adding in more consistency
to the code.
CONSISTENCY
.03
A d v a n t a g e s
D i s a d v a n t a g e s
A d v a n t a g e s
Colors will be very quick to write
especially with the #rgba shorthand.
QUICK TO WRITE
.01
Colors are identifiable at the first glance
because of a consistent notation followed
everywhere.
EASY IDENTIFICATION
.02
No switching between hex notation to
rgba() while working with translucent
colors thus adding in more consistency
to the code.
CONSISTENCY
.03
The tricky part of calculating the
hexadecimal alpha value.
CALCULATE HEX ALPHA
Each element is rendered into its own buffer
and is then merged with its backdrop.
BACKGROUND-BLEND-MODE
MIX-BEND-MODE
Compositing and
blending
background-blend-mode the combination
of a graphical element with its backdrop
COMPOSITING
.01
mix-blend-mode for elements over other
elements.
BLENDING
.02
background-blend-mode: normal | multiply | screen | overlay | darken |
lighten | color-dodge | saturation | color | luminosity | hard-light
background-blend-mode: normal | multiply | screen | overlay | darken |
lighten | color-dodge | saturation | color | luminosity | hard-light
background-blend-mode: normal | multiply | screen | overlay | darken |
lighten | color-dodge | saturation | color | luminosity | hard-light
mix-blend-mode: normal | multiply | screen | overlay | darken | lighten |
color-dodge | saturation | color | luminosity | hard-light
mix-blend-mode: normal | multiply | screen | overlay | darken | lighten |
color-dodge | saturation | color | luminosity | hard-light
FiltersFilters are a powerful tool that can be used
to achieve interesting visual effects.
#RRGGBBAA
CURRENTCOLOR
filter property applies graphical effects
to the area behind an element.
FILTER
.01
backdrop-filter property applies
graphical effects to the area behind an
element.
BACKDROP EFFECT
.02
filter: blur() | brightness() | contrast() | drop-shadow() | grayscale()
| hue-rotate() | invert() | opacity() | sepia() | saturate()
backdrop-filter: blur() | brightness() | contrast() | drop-shadow() |
grayscale() | hue-rotate() | invert() | opacity() | sepia() | saturate()
A fun and effective way to provide visual
unity and aesthetic appeal on the web.
AESTHETIC
.01
Filters are applied to the image after the
browser renders layout and initial paint.
PERFORMANCE
.02
More power available directly in the
browser.
FLEXIBLY
.03
A d v a n t a g e s
D i s a d v a n t a g e s
A d v a n t a g e s
Won’t render the designs exactly as we
intended.
BROWSER SUPPORT
A fun and effective way to provide visual
unity and aesthetic appeal on the web.
AESTHETIC
.01
Filters are applied to the image after the
browser renders layout and initial paint.
PERFORMANCE
.02
More power available directly in the
browser.
FLEXIBLY
.03
Shapes
SHAPE-OUTSIDE
CSS is capable of making all sorts of shapes.
shape-outside defines a shape around
which adjacent inline content should wrap.
WRAPPING
.01
shape-margin the distance between the
edges of the shape and the surrounding
content.
MARGIN
.02
shape-outside: circle() | ellipse() | polygon()
shape-outside: circle() | ellipse() | polygon()
Important for responsive interfaces.
DYNAMIC REFLOW
OF TEXT
.01
We can use the same clip-path
function values we used for clipping.
RE-USING VALUES
.02
Can set the bounding box to margin,
padding and border. This gives us fine
control over the position of these
relationships.
CONTROL
.03
A d v a n t a g e s
Clip paths
CLIP-PATH
CSS is capable of making all sorts of shapes.
clip-path() defines a closed shape
consisting of a set of connected straight line
segments
CLIPPING
.01
clip-path: circle() | ellipse() | polygon() | url()
clip-path: circle() | ellipse() | polygon() | url()
A d v a n t a g e s
Is easily achieved with relative units,
such as percentages.

RESPONSIVENESS
.01
The specification states that pointer
events must not be dispatched outside
the clipping area.
EVENTS RESTRICTED
.02
D i s a d v a n t a g e s
A d v a n t a g e s
All borders, shadows and outlines outside the
clipping region will be clipped.
NO VISIBLE OVERFLOW
Is easily achieved with relative units,
such as percentages.

RESPONSIVENESS
.01
The specification states that pointer
events must not be dispatched outside
the clipping area. So, the click event
is restricted to the shape and its outer
boundary. 
EVENTS RESTRICTED
.02
Online tools that agile your code process.
TOOLS
.03
Chrome: Extensions: CSS Shapes Editor
https://bennettfeely.com/clippy/
<header>
https://codepen.io/pedromsduarte/pen/OazVYp
CSS functionsOr should we call the
absolute power of CSS?
MAKING A POINT
https://github.com/you-dont-need/You-Dont-Need-JavaScript
https://codepen.io/collection/AKkZro/
https://rupl.github.io/fun-games-css/
Building a search engine in CSS
Thank you
References
INTRO
Piotr Galor
COLOR VALUES
https://tiffanybbrown.com/2017/08/css-4-color-hexadecimal-values-rrggbbaa/index.html
https://hashnode.com/post/understanding-rrggbbaa-color-notation-cisvdr52x088fwt53h1drf6m2
https://www.w3.org/TR/css-color-4/
https://stackoverflow.com/questions/5445085/understanding-colors-on-android-six-characters/25170174#25170174
https://css-tricks.com/colorme-css-color-level-4/
https://colorme.io/
BLEND-MODES
https://www.smashingmagazine.com/2016/05/web-image-effects-performance-showdown/
https://www.html5rocks.com/en/tutorials/filters/understanding-css/
https://cssduotone.com/
https://picturepan2.github.io/instagram.css/
CLIP PATHS
https://www.smashingmagazine.com/2015/05/creating-responsive-shapes-with-clip-path/

The amazing power of CSS