Professional Documents
Culture Documents
CHEAT SHEET
Created by @Manz ( http://twitter.com/Manz )
https://lenguajecss.com/
C CSS Syntax
C CSS Colors
GENERAL SYNTAX
COLOR PROPERTIES
color: color
opacity: 1 alpha
S CSS Selectors
/* comment */
COLOR MODELS
ATTRIBUTES
KEYWORDS
EXAMPLE /* IE sucks */
COLOR EXAMPLE
#unique
.c1
div
div
div
NUMERIC FORMAT
EXAMPLES
div + div
div ~ div
[attr="..." i]
EXAMPLES
COLOR COMPONENTS
IMPORTANT
EXAMPLE color:red!important;
STRUCTURAL
OTHERS
OTHERS
CHILD ELEMENTS
USER INTERFACE
USER ACTION
LINKS
PSEUDOCLASSES
COMMON VALUES
MATHEMATICAL EXPRESSIONS
vw viewport width %
vh viewport height %
vmin smaller (vw or vh)
vmax larger (vw or vh)
ANGLES
DURATIONS
px pixels
s seconds
deg degrees [0..360]
ms millisecs
cm centimeters
grad gradians [0..400]
mm millimeters
rad radians [0..6.28]
PERCENTAGES
Q quarter-mm
rad turns [0.0..1.0]
value %
in inches CUSTOM PROPERTIES (CSS VARIABLES)
EXAMPLE 75%
DECLARING
USING
pc picas
pt points -- varname : value ; var( -- varname , fallback ... )
EXAMPLE --size: 100px;
DEVICE SIZE
size
size
MIN MAX
device-width
device-height
size
size
aspect-ratio ratio
MIN MAX
device-aspect-ratio
ratio
number
MIN MAX
color-index
width
height
MIN MAX
ASPECT RATIO
MIN MAX
COLORS
MIN MAX
color
number
OTHERS
MIN MAX
MIN MAX
monochrome
resolution
orientation
scan
grid
EXAMPLES
number
device-min-width: 640px
dpi/dpcm
device-aspect-ratio: 16/9
max-color-index:256
portrait landscape
min-resolution:300dpi
progressive interlace
min-monochrome:2
number
grid:1
F Fonts
FONTS (TYPOGRAPHY)
ABS
REL
ABS
REL
S Speech Media
https://lenguajecss.com/
T CSS Text L3
TRANSFORMING TEXT
,
pre-wrap pre-line
white-space: normal pre nowrap
tab-size: 8 number size
LINE BREAKING & WORD BOUNDARIES
VOLUME/SPEAK
PAUSE
URI
pause-before: 0 time %
pause-after: 0 time %
pause: before after
MIXING/SPATIAL
REL
ABS
RGT
LFT
URI
speech-rate: number
SPEECH
lled open
EXAMPLE open circle;
@ CSS Rules
FONT LOADING
STATUS
serif font
monospaced font
sans serif font fantasy font
@font-face {
@media all screen print and (...) {
font-family: font ;
LINE HEIGHT CALCULATIONS (LEGACY)
property: value;
Media features
src: url( le.woff ) format("woff") ,
}
line-height: number % size normal
url( le.ttf ) format("truetype") ; EXAMPLE @media screen and (max-width: 640px) { ... }vertical-align: size % baseline middle sub super
unicode-range: U+000-27FF ;
CSS IMPORT RULES
text-top text-bottom top bottom
}
@import "index.css";
FONT FORMATS
CSS CONDITIONAL
@import url("index.css");
embedded-opentype truetype opentype svg woff woff2
not ( feature ) or and ... {
@supports
@import url("print.css") print;
EXAMPLE url(le.ttf) format("truetype");
property: value;
}
EXAMPLE @supports not ( display: exbox ) { .nav { display:block } }
https://lenguajecss.com/
B CSS Borders
DIMENSIONS
margin-top: 0 size %
margin-right: 0 size %
margin-bottom: 0 size %
margin-left: 0 size %
padding-top: 0 size %
padding-right: 0 size %
padding-bottom: 0 size %
padding-left: 0 size %
MARGIN SHORTHAND
PADDING SHORTHAND
3P
2P
OVERFLOW/VISIBILITY
SPECIFIC CORNERS
border-top-left-radius: 0 size %
border-top-right-radius: 0 size %
border-bottom-right-radius: 0 size %
border-bottom-left-radius: 0 size %
MAIN SHORTHAND
3P
2P
1P
BLK
LST
padding
margin
closest-side farthest-side
closest-corner farthest-corner
IMAGES AND OBJECTS
2-PARAMETER FORMAT
size-h size-v
1-PARAMETER
size-h = size-v
size-v
size-h
top
IMAGE SLICE
left
center
bottom
right
number %
IMAGE OUTSET
BORDER IMAGE
repeating-linear-*
number size
border-image-source: none url( img.png )
border-image-slice: 100% top right bottom left ll
border-image-width: 1 top right bottom left
border-image-outset: 0 top right bottom left
border-image-repeat: stretch repeat round space
border-image: source slice /width outset repeat
URI
size %
repeating-radial-*
DIRECTION
to top
left
215deg
90deg
to
right
145deg
180deg
to bottom
SIZING
B Backgrounds
LEVEL 2
35deg
270deg
to
bottom
left
to top
right
360deg
325deg
to
left
REPEAT-STYLE PARAMETERS
to top
to
bottom
right
outset
background-image:
radial-gradient( shape rsize at pos color1 start , color2 ... )
ridge
inset
B Rounded Corners
RADIAL GRADIENTS
shape rsize
circle radius at pos ...
ellipse rh rv at pos ...
double
groove
size-h
content
background-image:
linear-gradient( direction color1 start , color2 start , ... )
GRADIENT OPTIONS
dashed
TBL
LINEAR GRADIENTS
dotted
MAIN SHORTHAND
border-radius:
GRD
FLX
I CSS Images
GRADIENTS
solid
4P
1P
2P
3P
4P
SPECIFIC MARGINS
BORDER STYLES
MARGINS/PADDINGS
border-top-*
border-right-*
border-bottom-*
border-left-*
4P
margin:
SPECIFIC SHORTHANDS
BORDERS
FILTER VALUES
FILTER PROPERTY
FILTERS
https://lenguajecss.com/
C Compositing
COMPOSITING AND BLENDING
blur( blur )
0px = original >0px=blur
BLEND MODES
brightness( number % ) 0%=black 100%=original >100% ALLOWED
SEPARABLE
contrast( number % )
0%=grey 100%=original >100% ALLOWED
normal multiply screen overlay
saturate( number % )
0%=B&W 100%=original >100% ALLOWED
darken lighten color-dodge color-burn
grayscale( number % ) 0%=original 100%=B&W
0
hard-light soft-light difference exclusion
invert( number % )
0%=original 100%=invert
NON-SEPARABLE
270 deg 90
sepia( number % )
0%=original 100%=sepia
hue saturation color luminosity
0%=transparent 100%=original
opacity( number % )
180
hue-rotate( angle )
0deg=original 360deg=max
L Lists
drop-shadow( pos-x pos-y blur color ) (same as text-shadow)
LISTS
S CSS Shapes
FLOAT AREA SHAPE
1, 01
A, a
URI
REFERENCE BOX
GENERATED CONTENT
BASIC SHAPES
RECTANGLE
polygon( x0 y0 , ... , xi yi )
SHAPE RADIUS
STR
URI
ATT
content: normal none url( img.jpg ) attr( attr ) ' string '
open-quote close-quote no-open-quote no-close-quote
counter( name , list-style-type )
PSEUDOCLASSES
content-increment: none name
::before before element
content-reset: none name
::after after element
quotes: ' open-str ' ' close-str ' none EXAMPLE p::before { content: "-"; }
CNT
URI
MARKERS
CLIPPING SHAPE
POSITIONED MASKS
URI
RESIZE/OVERFLOW
clip-path: none
URI
M CSS Masks
https://lenguajecss.com/
T CSS Transitions
T CSS Transforms
TRANSITIONS
TRANSFORM PROPERTY
timing-function
s
n
s
n
s
f
n
n
n
n
s
n
n
s
s
cubic-bezier()
ease
linear
ease-in
ease-out
ease-in-out
2D TRANSFORMS
timing-function steps()
step-start
step-end
steps(n)
steps(a,b)
(1, start)
(1, end)
(n, end)
(a, b)
ANIMATIONS
animname1 5s linear ,
animname2 5s linear 5s ,
animname3 6s linear 10s ;
0% = from
M CSS Motion Paths 100% = to
ANIMATION KEYFRAMES
@keyframes animname {
0% { property: value; ... }
...
100% { property: value; ... }
}
@-vendor-keyframes
MOTION PATH
URI
SCROLL SNAPPING/SNAPPORT
SNAP MARGIN/PADDING
*-top: 0 size %
scroll-snap-type: none x y
*-right: 0 size %
block inline both mandatory proximity *-bottom: 0 size %
ALIGNMENT AND LIMITS
*-left: 0 size %
scroll-snap-align: inline-axis block-axis *: top right bottom left
scroll-snap-stop: normal always
INLINE/BLOCK
SCROLL SNAPPING/SNAPPORT
scroll-padding*:
scroll-snap-margin*:
AXIS
A CSS Animations
3D TRANSFORMS
column-rule-width:
column-rule-style:
column-rule-color:
column-rule: width
COLUMN BREAKS
CHEAT SHEET
Created by @Manz ( http://twitter.com/Manz )
F CSS Flexbox
https://lenguajecss.com/
P Positioning
CONTAINER PROPERTIES
POSITIONING
FLOATING
SPC
15 5
G CSS Grids
SECONDARY AXIS
SPC
CONTAINER GRIDS
EXPLICIT GRID
ITEM PROPERTIES
FLEXIBILITY
ex-grow: 0 number
ex-shrink: 0 number
ex-basis: auto content size %
ex: grow shrink basis
-5
AREA GRID
A CSS Align
grid-template-areas: " area1 area2 " ... " areaY areaZ "
CONTAINER PROPERTIES
BASELINE-POSITION
baseline last-baseline
none
template-rows / template-columns
template-areas + template-rows/columns
IMPLICIT GRID
grid-column-gap: 0 size %
grid-row-gap: 0 size %
grid-gap: row-gap column-gap
PRIMARY AXIS
SHORTHAND GRID
grid:
SECONDARY AXIS
ITEM PROPERTIES
PRIMARY AXIS
#grid { display:grid;
grid-template-areas: " head head"
"nav main"
"foot foot"; }
grid-template:
safe unsafe
justify-content/align-content:
normal baseline-position
space-between space-around space-evenly stretch
overow-pos self-position
OVERFLOW POSITION
SELF-POSITION
EXAMPLE
AREAS
CONTENT DISTRIBUTION
template
template-rows / auto-ow dense grid-auto-columns
auto-ow dense grid-auto-rows / template-columns
ITEM GRIDS
PLACEMENT SHORTHANDS
grid-area:
LINES
TABLES
SECONDARY AXIS
LINE-BASED PLACEMENT
template-area
row-start / column-start / row-end / column-end