european sharepoint webinar - make sharepoint sassy

55
Make SharePoint SASSY Webinar Stefan Bauer – n8d

Upload: stefan-bauer

Post on 15-Apr-2017

1.164 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: European SharePoint Webinar - Make SharePoint Sassy

MakeSharePointSASSYWebinar

StefanBauer– n8d

Page 2: European SharePoint Webinar - Make SharePoint Sassy

n8d.at/blog@StfBauer

Information ArchitectVienna / Austria

Page 3: European SharePoint Webinar - Make SharePoint Sassy

Make SharePoint SASSY!

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

Page 4: European SharePoint Webinar - Make SharePoint Sassy

BRANDING CHALLENGES

INTRODUCTION TO SASS

STRUCTURE YOUR BRANDING

Page 5: European SharePoint Webinar - Make SharePoint Sassy

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: European SharePoint Webinar - Make SharePoint Sassy

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

Solution7. DeploySolution8. Repeatstep1- 8

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

Page 7: European SharePoint Webinar - Make SharePoint Sassy

Modularize CSS

Find and identify UI elements faster

Divide complexity into smaller parts

Avoid developmentconflicts

Listingofalargecomputer program –Arnold Reinhold

Page 8: European SharePoint Webinar - Make SharePoint Sassy

Avoid Repeating Tasks

Reusable components

More maintainable code

Page 9: European SharePoint Webinar - Make SharePoint Sassy

On-premises Inthecloud

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

Page 10: European SharePoint Webinar - Make SharePoint Sassy

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: European SharePoint Webinar - Make SharePoint Sassy

CSS Spaghetti Code

Page 12: European SharePoint Webinar - Make SharePoint Sassy

BRANDING CHALLENGES

INTRODUCTION TO SASS

STRUCTURE YOUR BRANDING

Page 13: European SharePoint Webinar - Make SharePoint Sassy

What is SASS

AlayerbetweenstylesheetsandCSS

faster,moreefficient,andeasiertomaintain.

MyBranding.css

Layout

TypoColors

Sass (short for Syntactically Awesome Style Sheets)

Page 14: European SharePoint Webinar - Make SharePoint Sassy

SASS– Chooseyourstyle

SASS– SyntaxTheoldschoolRUBYbasedsyntaxFileextension: .sass

SCSS– SyntaxLikeyouwritingnativeCSSFileextension: .scss

Page 15: European SharePoint Webinar - Make SharePoint Sassy

SASS – for developerHackCSS

Benefitofaprogramminglanguage

Calculatestheheadlinefontbasedonadynamicratio.Createafontshorthanddefinitionbymergingallthefontpropertieslikethis.

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

Page 16: European SharePoint Webinar - Make SharePoint Sassy

SASS- Variables

Page 17: European SharePoint Webinar - Make SharePoint Sassy

W3C- CSSVariables– Specification

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

CSS– Variables

PostCSS– JavaScript

Page 18: European SharePoint Webinar - Make SharePoint Sassy

SASS– Nesting<Parent

Page 19: European SharePoint Webinar - Make SharePoint Sassy

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: European SharePoint Webinar - Make SharePoint Sassy

SASS- @extend

Defineelementonce– reuseitwithoverrides

Page 21: European SharePoint Webinar - Make SharePoint Sassy

SASS– Placeholder@extend

“%”actslikeanewpseudoselectorinadditiontoclassandidcss selector

Extendelementtemplateswithoutextendingcompilingtheselectoritself

Page 22: European SharePoint Webinar - Make SharePoint Sassy

SASS– Placeholder@extend

Page 23: European SharePoint Webinar - Make SharePoint Sassy

SASS- @mixin /@include

@mixin

• Re-usebiggerchunksofCSS• Actslikefunctions• Passparameter• Defaultvaluesfor

parameter

@include

• ExtendaselectorwithCSS

Page 24: European SharePoint Webinar - Make SharePoint Sassy

SASS- @mixin

CSS3transitionmixin andbrowserfallbackdefinitions

Page 25: European SharePoint Webinar - Make SharePoint Sassy

SASS- @include

Page 26: European SharePoint Webinar - Make SharePoint Sassy

@import– CSSvsSASS

CSS

• Eachfilewillberequestedseparately• SlowdownUI• Don’tuseit

SASS

• CompilespartialsitintoCSSfile• SupportsCSSimport• Allowstostructurethedesign

Page 27: European SharePoint Webinar - Make SharePoint Sassy

@import– CSSvsSASS

Filename:_yourvariables.scss

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

Don’tforgettheunderscore!

Page 28: European SharePoint Webinar - Make SharePoint Sassy
Page 29: European SharePoint Webinar - Make SharePoint Sassy

WhySASS?

• CSSwithsuperpower!• Cleanstructuredcode• Reusablecomponents

• Consistency

•ManyExtensions

OrganizingCSS:• OOCSSObjectorientedCSS

• SMACSSScalableandModularArchitectureforCSS

• BEMBlockElementModifier

Blogpost:OrganizingCSS:OOCSS,SMACSS,andBEM

Page 30: European SharePoint Webinar - Make SharePoint Sassy

geminstallsassSASSinVisualStudioVS2013– Updated2

Tryout&Learn

http://sassmeister.com

Page 31: European SharePoint Webinar - Make SharePoint Sassy

Yeoman – yeoman.io

Runsonallmajorplatforms(Windows,Mac,Linux)

Webrelatedtemplateengine

Platform TaskRunnerLikeMSBuild

BowerLikeNuGet

Page 32: European SharePoint Webinar - Make SharePoint Sassy

Yeoman – recommended templates

� generator-webapp – deprecatedTemplateforwebapplications– grunt gulp

� generator-gulp-webappTemplateforwebapplications– gulp

� generator-angularTemplateforangularjs

� YOOFFICE!- MicrosoftOfficeProjectGeneratorTemplateforwritingMicrosoftOfficeadd-ins(akaapps)

Page 33: European SharePoint Webinar - Make SharePoint Sassy

Yeoman – generator-webapp

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

Page 34: European SharePoint Webinar - Make SharePoint Sassy

Work LocallyInjectCSSandJS

Nodeploymentdowntime

UseJSOM/RestAPI

LikeanAdd-in(App)

FullSASSSupport

WorksforOffice365andon-premises

Page 35: European SharePoint Webinar - Make SharePoint Sassy

Work Locally

- IntegrateYeomanintoSharePoint- FontresetinSharePoint- RichTextEditormixin

DEMO

Page 36: European SharePoint Webinar - Make SharePoint Sassy

WorkLocally– moreinformation

Gettingstarted

HowIdevelopinSharePointandOffice365now

HowtouseCSSandJavaScriptfilesfromYeomandirectlyinSharePoint

Page 37: European SharePoint Webinar - Make SharePoint Sassy

Make SharePoint Responsive

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

Page 38: European SharePoint Webinar - Make SharePoint Sassy

1. Defineandcreategridlayout

2. Definemediabreakpoints

3. Definehowthecontentlooks

ResponsiveWebDesign

Page 39: European SharePoint Webinar - Make SharePoint Sassy
Page 40: European SharePoint Webinar - Make SharePoint Sassy

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

- SusyGrid /Tutorials

- SASSMediaqueriesProjectongithub

Page 41: European SharePoint Webinar - Make SharePoint Sassy

DEMO

Page 42: European SharePoint Webinar - Make SharePoint Sassy

BRANDING CHALLENGES

INTRODUCTION TO SASS

STRUCTURE YOUR BRANDING

Page 43: European SharePoint Webinar - Make SharePoint Sassy

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

Page 44: European SharePoint Webinar - Make SharePoint Sassy

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

Page 45: European SharePoint Webinar - Make SharePoint Sassy

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: European SharePoint Webinar - Make SharePoint Sassy

Modern Style Guides

- HTMLbasedstyledocumentation- Dynamicandextendable- AllowtobuildnewUIComponents- Allowsteamstoworkbettertogether

Page 47: European SharePoint Webinar - Make SharePoint Sassy

Modern Design Style Guides

- HTMLbased- DynamicStyleDocumentation- AllowtobuildnewUIComponents- Allowsteamstoworkbettertogether

Page 48: European SharePoint Webinar - Make SharePoint Sassy

Atomic Web Design – Brad Frost

Page 49: European SharePoint Webinar - Make SharePoint Sassy
Page 50: European SharePoint Webinar - Make SharePoint Sassy
Page 51: European SharePoint Webinar - Make SharePoint Sassy

http://patternlab.io

Page 52: European SharePoint Webinar - Make SharePoint Sassy

Recap– SASS•SASS helpsyoutowritebetterCSS•Keepaneyeonthesourcecode•Wellstructured

•SupportsDRY (Don’trepeatyourself)yourdevelopment

Page 53: European SharePoint Webinar - Make SharePoint Sassy

Recap- Createyourownstyleguide

•SketchinHTMLfirst•Createreusablecomponents•Documentalldesignassets•Addthingsyouneedratherthanuseafullversionofframework

Page 54: European SharePoint Webinar - Make SharePoint Sassy

Resourcesusedindemo

•HowIdevelopinSharePointandOffice365now•ApplygridsystemtoSharePointusingSusy•PureCSSBurger•SharePointFontReset•ResponsiveSharePointProjectonGitHub

Page 55: European SharePoint Webinar - Make SharePoint Sassy

HavefunmakingSharePoint