CSS Master
Figure 8.8. Our stroke-dasharray transition near its end Unfortunately,there'salimittohowmuchwecananimateusingCSS.Forinstance, w ...
Figure 8.9. A logo and word mark for the fictitious Hexagon Web Design & Development Withoutmediaqueries,thisSVGlogowouldsim ...
<polygon id="hexagonbg" points="55.2,162 10,86.5 55.2,11 ➥ 145.5,11 190.7,86.5 145.5,162 "/> <path id="letterH" fill="# ...
<object data="hexlogo.svg" type="image/svg+xml" ➥ style="width: 20em;"></object> Figure 8.10. Showing/hiding element ...
var svg, originalViewBox, max20em, mq, updateViewBox; svg = document.querySelector('svg'); /* Store the original value in a vari ...
Figure 8.11. An SVG logo with media queries when the object container is 20em (top) wide and 40em wide Sincethistechniqueusesthe ...
<?xml version="1.0" encoding="utf-8"?> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" ➥ xmlns:xlink ...
background-size: 300px auto; } li { background-size: 20px auto; background-repeat: no-repeat; background-position: left 3px; pad ...
...
Chapter 9 Preprocessors 9. Preprocessors AuthoringCSScanbetedious.There’sasetofrepeatedcolorsandfontstomanage andremember.Weneed ...
popular.Whilenotacomprehensivelookateithertool,itwillbeenoughtogetyou started. Whichpreprocessortochoosedependsonwhichsyntax,too ...
lessc /path/to/lessstylesheet.less You’llneedtorunlessceverytimeyouwishtocompileyourLessfilestoCSS. Onewayaroundthislimitationis ...
gem install sass OSXandLinuxusersmayneedtousesudo. Using Sass from the Command Line AswithLess,youcanuseSassfromthecommandlineto ...
Ruleset Nesting RulesetnestingcanimprovetheorganizingofyourCSSbygroupingrelatedstyles. Italsosavessomekeystrokes. Considerthefol ...
a { text-decoration: none; border-bottom: 2px solid #000; &:link{ border-bottom-color: #fc0; } &:hover { border-bottom-c ...
position: relative; &::after { content: ' '; display: block; clear: both; } } } Herewe’venestedstylesfor::afterinsideadeclar ...
} } } Thisisn’ttooegregious,right?Our[lang]selectorisonlyfourlevelsdeep,butlet's lookatourcompiledCSSoutput: article { color: #2 ...
ingtotalpageloadtime.Moregenerally,thegreateramountofHTTPrequestsyou have,themoretimeittakesapagetodownloadallofyourassets.^10 F ...
body { background: #FFFDFB; color: #222; font: 100 16px / 1.5 sans-serif; } @import "errors"; Noticethat@import "errors";comesat ...
Variables Anotherfeatureofpreprocessorsarevariables. Variables allow us to store a value―say, a font size or color―in one place ...
«
11
12
13
14
15
16
17
18
19
20
»
Free download pdf