I washereinBerlinatCSSConferenceJazzConfortheveryfirsttimeinmylifelastyear.
Anditwasoneofthemostamazingexperiencesoffmylife.
So I reallywanttothanktheorganizer's forbringingmeoutagainandorganizingthisspectacularevent.
Now I know.
I discoveredfrom a colleagueofmineAlexeLakatos, somewhereintheaudiencethatthedeathTollsconsolecantotallybestyledupwithCSSCaseinpointthisgloriousCSSonlytalktitleintheconsole.
Somynameiswagingand I'm a developeradvocatewithnextmole.
MycolleagueGavinwillalsobespeakingatJamesCaanwerereallyfriendlypeopleandnextmomentdoescommunicationsapeyesanddukeitjustcomeSayhiifyougot a minuteright?
Who I amas a personIfyou'recuriousaboutanyoneofthem, youcanaskmeaboutthemlater.
Andlastly, justtoprove a pointthatFirefoxsupportsthemostCSSpropertiesintheconsole.
I mean, it's verticalwritingintheconsole, so I don't knowaboutyou, but I loveitnow.
When I startedbuildingstuffontheWeb, I quicklyrealizedthataligningstuffhorizontallywaswaymoreeasythanaligningstuffvertically.
And I startedthinkingaboutwhythatWAAS, nowhistoricallywettechnology, startedupfromtextdocumentbeginningsand a lotoftheinitialHTMLtagsandCSSpropertiesfocusmainlyontextformattingforlanguages, youknow, likeEnglishandFrench, thatwerelaidoutpredominantlyfromhorizontallyfromtoptobottom.
I mean, browsershavealwaysmanagedtofigureouthowmuchspacecontenttakeupwithoutanyinterventionfromus.
Thecontentjustreflowswithoutoverlapping.
Butwhatisintroducedinthisrelativelynewersee a suspectcalledCSSintrinsicanextrinsicmodulelevelthreeisthatitintroduceussomekeywordsthatallowustoapplyautomaticwithontoourelementsonthepage.
Soifwelookatthisfirstblockoffcontenthere, I'vesizedthemwithmencontent, and I hopeyoucansortofsee I'lljustpullusup a bit.
ItssizewithMincontentandmencontentisthesmallestsizethat a boxcantake, whichdoesn't leadtooverflow.
Soinlinecontent.
If I couldpointyourdirectionhere, you'llseethattheonlinecontentwillbreakintomultiplelines, notlinebreakinghas a lotmorenuancedthanmostpeoplegiveitcreditfor, becausedependingonthelanguagethatisbeingusedonscreenmen, contentisgonnaenduplookingverydifferently.
Andthelineswillbreakdifferentlyaswell.
For a lotoflanguages, months, mostlytheLatinbasedscriptslikeEnglishorGermanlinebreakswilloccuratwordboundaries, wherespacesorpunctuationaren't usedtoexplicitlyseparatethewords.
Soifyou'lllookatthesecondsetofcontentthatissizedwithMaxcontentandlet's talkaboutMaxcontentfor a bit, Maxcontentis a boxer's idealsizein a givenaccesswhenthere's unlimitedspace.
Itis a rangewheretheminimumvalueismencontent, whilethemaximumvalueiseitherthemaxcontentvalueorthevaluethatyouputinsidethisfunction, whicheverissmaller.
Sothismakesmoresenseif I showyouwhat's goingonnow.
I thinkit's bettertolookatthesecondandthirdbecausetheyhaveexactlythesamecontent.
Soif I shiftthisandwerunoutofspace, it's gonnashrink, shrink, shrinkuntilit's themencontentwithforboth.
Andonething I wanttoremindeveryoneisthatthespecificationsactuallyrecommendsthatweusekeywhatvaluesonflexitemsbecausetheycoverthemostcommonusecasesandtheyresetthevalueswithinthethreeflexflexpropertiesappropriatelysowhat's goingtohappenisthatthesekeywordsinitialnoneautoand a positiveinteger, whichgetsresolvedtotheflexgrowthfactor.
Soinitialisthedefaultvalueforflexitems.
If, say, I saiddisplayflexontheparentandthen I don't doanythingtotheChildren.
Itgets a valueoffdisplayflex, andwecansortoffigureoutwhatthebrowserdoeswhenitencounterssuchkeywordsbygoingtothecomputertab.
If I changethistosomethingelse, let's sayflexnoneright, whichmakesyourflexitemscompletelyinflexible, andyougobacktothecomputertapwilltellyouthatOh, nowflexgoesyourflexshrinkisnowalsozeroandautoandsoon.
Ifyou'reinterestednow, I thinksizinggetsconfusinguntilweget a clearerunderstandingofwhat's goingonwiththeflexbasispropertyspecifically.
Forexample, if I put a fixedvalueof 100 pixelsastheflexbasis, it's notsurprisingthatsomepeoplewillexpecttosee a boxoff 100 pixelsbecausewe'reveryusedtobeingincontrolofoursizinginstructions.
Sowhenthere's noexplicitwithseton a flexitemandtheflexbasisisalsosettoauto, thebrowserisgoingtousethecontentseyesasthestartingpointtocalculatethewidthoftheflexitem.
Butifyouhaven't explicitwithsetSo I'm goingtodothatforthisparticularitem, I'm gonnaset a whiffof 200.
Hopefullynotmytrickforrememberingwhichpropertiesapplytowhichaccessisthat I personally I associatethewordjustifywith, liketextprocessingtexteditorslikeMicrosoftWord, wheretheygotthoseforiconsinthetoolbarandthatusefirsttoshifttextaroundinthehorizontalaxis.
Sofor a languagelike, say, EnglishorGerman, when I seejustify, I think, Oh, that's thedirectionthattextcloseandbecausethey'reonlytwoaxes, right?
Sonaturallytheotherword, whichis a line, goesalongtheverticalaxis.
Now, whenitcomestothecrossaccessortheverticalaxis, theitemsarestretchedtothefullheightof a flexlinethemomentyouapply a displayflexontheparent.
Sothisisthesearenotintheoriginalheightsofmyitems.
If I wanttoseewhattheoriginalheightsare, I'm gonnaapply a turnthisoffGonnaapply a a lineitemsproperty.
Let's doend.
Theseareactuallythetheoriginalheightsoffmyelementsright, andoneinterestingvaluethat I don't seeuseveryoftenisbaseline, becauseifyouhavesomethinglikewhat I havehere, it's a varietyofsizesofidea.
Lineman's a varietyoffunsizeisyou'llseethatthetextiskindoflikemountainous, andit's prettyhardtoread.
Soifyouhave, say, textwithinflexitemsthatarerelatedtoeachotherandyouwantyouraudiencetosaycomprehendssomethingfromthewordsyoucouldconsiderusingbaselineanditmakeseverything a bitmorereadable, I thoughtthispropertyatthisvalueusparticularlyinteresting.
Onemorethingis a linecontent.
Sowhatyoucandoissayyourflexcontainerislarger, thenthesizeofyourflexlinesonjustputanarbitraryvalues a 90 V hitch, right?
Sotheseflecksontheseboxalignmentpropertiesarereallyhandywhenitcomestoaligningboxesalong a verticalaxis, whichissomethingthatwasreallychallenginginthepast.
Andnowlet's coversomecommonusecases.
Thisis I knowthisisprobablyanexamplethateveryonehasshown, but I want I wanttoshowitbecause I reallylikeit.
Andthatisautomarginsagain.
Theyareyourfriend.
Ifyouhadn't oneiteminyourflexcontainerinsteadofusingtheboxalignmentproperties, youcanjustset a marginoffautotocenterit.
Onelinesolvesallyourproblemsbecause, unlikeinthecurrentimplementationoffmarginsin a blockformattingcontextusingmarginautowellcentertheitemareverticallyaswell.
A morepracticalusecase, I wouldsay, islike a navigationbarwhereSometimesyouneedthisendlinkallonitslows, lonesomeontherightandratherthanstrugglingwith, youknow, floatingleftfloatingwhite, right, whatever.
Youcanjustuse a marginleftautotokickitallthewaytotherightandcallit a day.
Sowhatflexiblesizing I findextremelyinterestingissotoexplainit, I'm goingtodosomeisolatedusecases.
Sofirstthing, let's compare f ourunitsversusautonowbecauseRachelhasalreadycoveredhowusefultheGreatInspectoris.
So I justwanttoreiterateherpointthismorningisthatifyou'regonnabeplayingaroundwithgrid, whetheryou'rejuststartingoutoryou'realreadyusingitforproduction, youknowFirefoxprobablyisyourbestbetbecauseoffthegridinspectorandagain, youcantoggleitbyclickingthegreattagoryoucangotothelayout, andthat's whereyougettoselectbecause I havetonsofgrits.
Sowhenthere's FRevertakesupalltheavailablespaceandauto, just, youknow, staysinitsownlatelikeMaxcontentandthat's finewhenthere's notenoughspace, however, sonow I'm referringtothisthirdsetofcontent, F R isgonnashrink.
S s propertieshere, it's a gridright, andyoucansortofseethecode.
It's notthatstraightforward, butwhathappensisthatitfunctions a lotbetteratthemoreextremewitsbecauseofthisvariablesizingbehaviorandalso a greatmakesitveryeasytodooverlap.
Sothishaving a titleoverlapyourimageis a verytrivialthingtodoifyou'reusinggrit.
Andso I'm veryexcitedforallofthisstuffthat I justmentionedtobecomemoremainstreamandtohaveMaur, youknow, designersanddevelopersstartconsideringthepossibilitiesintheirdesign.