espc15 - make sharepoint sassy€¦ · make sharepoint sassy! - i will explain what sass is and how...

55
Make SharePoint SASSY Webinar Stefan Bauer – n8d

Upload: others

Post on 24-May-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

MakeSharePointSASSYWebinar

StefanBauer– n8d

Page 2: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

n8d.at/blog@StfBauer

Information ArchitectVienna / Austria

Page 3: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Make SharePoint SASSY!

- IwillexplainwhatSASSisandhowyoucanuseit- HowtouseSASStobrandSharePointwithoutrequiringlengthydeployments.- HowtocreatesimpleRichTextEditorStylesusingmixins andincludes.- HowtoapplyaGridlayoutandmakeitResponsive.- Howtostructureyourbrandingcorrectlytomakeitmoremaintainable.- HowCSS4fitsintothepictureanddoesitmakeSASSobsolete?

Page 4: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

BRANDING CHALLENGES

INTRODUCTION TO SASS

STRUCTURE YOUR BRANDING

Page 5: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

2013 / 2016 Office 365

Changed SharePoint Development

2003 2007 / 20102013

Inject CSS154 files

Search & Destroy

Golden AgeOf

Master Page

CSS or JS

Cloud or On-Premises

Page 6: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Old Workflow1. Createafarmsolution2. AddMasterPage3. AddCSSFile4. Deploy5. CustomizeCSSFileonServer6. CopyfinalCSSFiletoFarm

Solution7. DeploySolution8. Repeatstep1- 8

PROS:- Workedprettywell- CentralizedDesignFiles- GhostingCONS:- DevelopmentontheServer- Legacyfarmsolution- OnesingleCSSFile- Notcloudready

Page 7: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Modularize CSS

Find and identify UI elements faster

Divide complexity into smaller parts

Avoid developmentconflicts

Listingofalargecomputer program –Arnold Reinhold

Page 8: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Avoid Repeating Tasks

Reusable components

More maintainable code

Page 9: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

On-premises Inthecloud

?Source:http://my.n8d.at/1MVjnEV

Page 10: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Why is CSS the way it is?

CSS stops short of even more powerful features that programmers use in their programming languages: macros, variables, symbolic constants, conditionals, expressions over variables, etc. That is because these things give power-users a lot of rope, but less experienced users will unwittingly hang themselves; or, more likely, be so scared that they won’t even touch CSS. It’s a balance. And for CSS the balance is different than for some other things.– Bert Bos – A list apart

Page 11: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

CSS Spaghetti Code

Page 12: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

BRANDING CHALLENGES

INTRODUCTION TO SASS

STRUCTURE YOUR BRANDING

Page 13: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

What is SASS

AlayerbetweenstylesheetsandCSS

faster,moreefficient,andeasiertomaintain.

MyBranding.css

Layout

TypoColors

Sass (short for Syntactically Awesome Style Sheets)

Page 14: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

SASS– Chooseyourstyle

SASS– SyntaxTheoldschoolRUBYbasedsyntaxFileextension: .sass

SCSS– SyntaxLikeyouwritingnativeCSSFileextension: .scss

Page 15: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

SASS – for developerHackCSS

Benefitofaprogramminglanguage

Calculatestheheadlinefontbasedonadynamicratio.Createafontshorthanddefinitionbymergingallthefontpropertieslikethis.

CSS:font:italicsmall-capsbold1em/140%Helvetica,sans-serif;

Page 16: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

SASS- Variables

Page 17: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

W3C- CSSVariables– Specification

:root{--main-color:#06c;--accent-color:#006;}/*make useofvariables.*/#foo h1{color:var(--main-color);}

CSS– Variables

PostCSS– JavaScript

Page 18: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

SASS– Nesting<Parent

Page 19: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

SASS – Variables - Data types

• Numbers1.2,13,10px

• Strings withorwithoutquotes"foo",'bar',baz

• Colorsblue,#04a3f9,rgba(255,0,0,0.5)

• Booleanstrue /false

• Nullsnull – what else

• Listofvaluesseparated byspaces orcommas1.5em1em02emHelvetica,Arial,sans-serif

• Maps from onevaluetoanother(key1:value1,key2:value2))

Page 20: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

SASS- @extend

Defineelementonce– reuseitwithoverrides

Page 21: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

SASS– Placeholder@extend

“%”actslikeanewpseudoselectorinadditiontoclassandidcss selector

Extendelementtemplateswithoutextendingcompilingtheselectoritself

Page 22: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

SASS– Placeholder@extend

Page 23: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

SASS- @mixin /@include

@mixin

• Re-usebiggerchunksofCSS• Actslikefunctions• Passparameter• Defaultvaluesfor

parameter

@include

• ExtendaselectorwithCSS

Page 24: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

SASS- @mixin

CSS3transitionmixin andbrowserfallbackdefinitions

Page 25: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

SASS- @include

Page 26: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

@import– CSSvsSASS

CSS

• Eachfilewillberequestedseparately• SlowdownUI• Don’tuseit

SASS

• CompilespartialsitintoCSSfile• SupportsCSSimport• Allowstostructurethedesign

Page 27: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

@import– CSSvsSASS

Filename:_yourvariables.scss

UseinSASSFile:@import‘yourvariables’@import‘core/mixins’

Don’tforgettheunderscore!

Page 28: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy
Page 29: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

WhySASS?

• CSSwithsuperpower!• Cleanstructuredcode• Reusablecomponents

• Consistency

•ManyExtensions

OrganizingCSS:• OOCSSObjectorientedCSS

• SMACSSScalableandModularArchitectureforCSS

• BEMBlockElementModifier

Blogpost:OrganizingCSS:OOCSS,SMACSS,andBEM

Page 30: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

geminstallsassSASSinVisualStudioVS2013– Updated2

Tryout&Learn

http://sassmeister.com

Page 31: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Yeoman – yeoman.io

Runsonallmajorplatforms(Windows,Mac,Linux)

Webrelatedtemplateengine

Platform TaskRunnerLikeMSBuild

BowerLikeNuGet

Page 32: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Yeoman – recommended templates

� generator-webapp – deprecatedTemplateforwebapplications– grunt gulp

� generator-gulp-webappTemplateforwebapplications– gulp

� generator-angularTemplateforangularjs

� YOOFFICE!- MicrosoftOfficeProjectGeneratorTemplateforwritingMicrosoftOfficeadd-ins(akaapps)

Page 33: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Yeoman – generator-webapp

- Webserver(Node.js)- IntegratedSASSsupport- Auto-compileSASStoCSS- Autoreloadwebpage- CSScanbeintegratedintoSharePointon-premisesorOffice365

Page 34: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Work LocallyInjectCSSandJS

Nodeploymentdowntime

UseJSOM/RestAPI

LikeanAdd-in(App)

FullSASSSupport

WorksforOffice365andon-premises

Page 35: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Work Locally

- IntegrateYeomanintoSharePoint- FontresetinSharePoint- RichTextEditormixin

DEMO

Page 36: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

WorkLocally– moreinformation

Gettingstarted

HowIdevelopinSharePointandOffice365now

HowtouseCSSandJavaScriptfilesfromYeomandirectlyinSharePoint

Page 37: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Make SharePoint Responsive

http://www.zeendo.com/info/wp-content/uploads/2013/03/responsive-web-design.jpg

Page 38: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

1. Defineandcreategridlayout

2. Definemediabreakpoints

3. Definehowthecontentlooks

ResponsiveWebDesign

Page 39: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy
Page 40: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Susy GridYourLayout- ourmath- Calculategrid- Easytouse- BuiltonSASS- EasySharePointintegration

- SusyGrid /Tutorials

- SASSMediaqueriesProjectongithub

Page 41: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

DEMO

Page 42: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

BRANDING CHALLENGES

INTRODUCTION TO SASS

STRUCTURE YOUR BRANDING

Page 43: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

We’re not designing pages,we’re designing systems of components. Stephen Hay

Page 44: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Responsive deliverables should look a lot like fully-functioning Twitter Bootstrap-style systems custom tailored for your clients’ needs. –Dave Rupert

Page 45: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Beware of MICRO BRANDINGJSLink, Display Templates and Script Embed Web Parts allow you to add additional styles to SharePointThe problem is how the styles.

Page 46: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Modern Style Guides

- HTMLbasedstyledocumentation- Dynamicandextendable- AllowtobuildnewUIComponents- Allowsteamstoworkbettertogether

Page 47: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Modern Design Style Guides

- HTMLbased- DynamicStyleDocumentation- AllowtobuildnewUIComponents- Allowsteamstoworkbettertogether

Page 48: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Atomic Web Design – Brad Frost

Page 49: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy
Page 50: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy
Page 51: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

http://patternlab.io

Page 52: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Recap– SASS•SASS helpsyoutowritebetterCSS•Keepaneyeonthesourcecode•Wellstructured

•SupportsDRY (Don’trepeatyourself)yourdevelopment

Page 53: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Recap- Createyourownstyleguide

•SketchinHTMLfirst•Createreusablecomponents•Documentalldesignassets•Addthingsyouneedratherthanuseafullversionofframework

Page 54: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

Resourcesusedindemo

•HowIdevelopinSharePointandOffice365now•ApplygridsystemtoSharePointusingSusy•PureCSSBurger•SharePointFontReset•ResponsiveSharePointProjectonGitHub

Page 55: ESPC15 - Make SharePoint Sassy€¦ · Make SharePoint SASSY! - I will explain what SASS is and how you can use it - How to use SASS to brand SharePoint without requiring lengthy

HavefunmakingSharePoint