+ All Categories
Home > Software > SLDS and Lightning Components

SLDS and Lightning Components

Date post: 16-Apr-2017
Category:
Upload: salesforce-developers
View: 1,351 times
Download: 1 times
Share this document with a friend
88
SLDS and Lightning Components Stephanie Rewis Lead Developer, Design Systems @stefsull Greg Rewis Principal Developer Evangelist @garazi
Transcript
Page 1: SLDS and Lightning Components

SLDS and Lightning Components

Stephanie Rewis Lead Developer, Design Systems

@stefsull

Greg Rewis Principal Developer Evangelist

@garazi

Page 2: SLDS and Lightning Components

Forward Looking StatementThis presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.

The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of intellectual property and other litigation, risks associated with possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-Q for the most recent fiscal quarter. This documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site.

Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.

Page 3: SLDS and Lightning Components

Why did Salesforce need a Design System?

Page 4: SLDS and Lightning Components

Lightning Experience

Page 5: SLDS and Lightning Components

Hundreds of Developers Small Team of Designers

Smaller Design Systems Team

Page 6: SLDS and Lightning Components
Page 7: SLDS and Lightning Components
Page 8: SLDS and Lightning Components

How can my app look like this?

Page 9: SLDS and Lightning Components

Can I use the CSS in my app?

Page 10: SLDS and Lightning Components
Page 11: SLDS and Lightning Components

Lightning Design System The next generation of living style guides

Page 12: SLDS and Lightning Components

Design System Components CSS Framework + UI Library

Page 13: SLDS and Lightning Components

Design audit and inventory of all components in designer's comps

Page 14: SLDS and Lightning Components

Border Colors

Shadows

Spacing

Sizing

Animation Durations

Media Queries

z-indexes

Some Design Token Properties Fonts

Font Sizes

Font Weights

Line Heights

Background Colors

Text Colors

Page 15: SLDS and Lightning Components

.lookup__menu { position: absolute; margin-top: t(spacingXxSmall); border: t(borderWidthThin) solid t(colorBorder); border-radius: t(borderRadiusMedium); padding: t(spacingXxSmall) 0; background: t(colorBackgroundAlt); z-index: t(zIndexDropdown); }

Page 16: SLDS and Lightning Components

We broke the components down to their smallest patterns and objects.

Page 17: SLDS and Lightning Components

SLDS Micropatterns

Page 18: SLDS and Lightning Components
Page 19: SLDS and Lightning Components
Page 20: SLDS and Lightning Components
Page 21: SLDS and Lightning Components
Page 22: SLDS and Lightning Components
Page 23: SLDS and Lightning Components
Page 24: SLDS and Lightning Components
Page 25: SLDS and Lightning Components
Page 26: SLDS and Lightning Components
Page 27: SLDS and Lightning Components
Page 28: SLDS and Lightning Components
Page 29: SLDS and Lightning Components
Page 30: SLDS and Lightning Components
Page 31: SLDS and Lightning Components
Page 32: SLDS and Lightning Components

/components/utilities/lists#flavor-vertical-dividers

Page 33: SLDS and Lightning Components

/components/utilities/lists#flavor-vertical-dividers

Page 34: SLDS and Lightning Components

/components/utilities/lists#flavor-horizontal-dividers

Page 35: SLDS and Lightning Components
Page 36: SLDS and Lightning Components
Page 37: SLDS and Lightning Components
Page 38: SLDS and Lightning Components

Block Element Modifier

BEM Naming Convention

Page 39: SLDS and Lightning Components

Let’s build a house!

.house block or component name

.house__door

.house__window element or component part

.house--gray modifier or component variation

.house__door--fuschia variation of a component part

Page 40: SLDS and Lightning Components
Page 41: SLDS and Lightning Components

FlexboxCSS box model optimized for user interface design.

Page 42: SLDS and Lightning Components

The SLDS grid system provides a flexible, mobile-first, device-agnostic scaffolding system

The SLDS grid system provides a flexible, mobile-first, device-agnostic scaffolding system

Page 43: SLDS and Lightning Components

/components/utilities/grid/

Page 44: SLDS and Lightning Components

Advantages of Flexbox Grids

Automatic Sizing Lowers the bar for error. Great for component layouts.

Manual SizingGreat for page layouts and responsive design.

Direction can be Manipulated Your content can flow from left to right, top to bottom, right to left, bottom to top.

Nested GridsNest grids inside grids. It’s fast and efficient.

Page 45: SLDS and Lightning Components

<div  class="slds-­‐grid">                   …  

</div>

Page 46: SLDS and Lightning Components

<ul  class="slds-­‐grid">                   …  

</ul>

Page 47: SLDS and Lightning Components

<span  class="slds-­‐grid">                   …  

</span>

Page 48: SLDS and Lightning Components

Extensible

We provide a library of helpers that can modify the grid container or individual grid regions.

We use verbose, human-readable classes.

Page 49: SLDS and Lightning Components

<div  class="slds-­‐grid  slds-­‐grid-­‐-­‐vertical">  …  

</div>

Page 50: SLDS and Lightning Components

<div  class="slds-­‐grid  slds-­‐grid-­‐-­‐vertical">  …  

</div>

Page 51: SLDS and Lightning Components

Flex-wrap

.slds-wrap { // This is placed on the .grid container flex-wrap: wrap; align-items: flex-start }

Page 52: SLDS and Lightning Components

<ul  class="slds-­‐grid">  ...  

<li>...</li>  <li>...</li>  

...  </ul>

Page 53: SLDS and Lightning Components
Page 54: SLDS and Lightning Components

<ul  class="slds-­‐grid">  ...  

<li  class="slds-­‐col">...</li>  <li  class="slds-­‐col">...</li>  

...  </ul>

Page 55: SLDS and Lightning Components

<ul  class="slds-­‐grid">  ...  

<li  class="slds-­‐col">...</li>  <li  class="slds-­‐col">...</li>  

...  </ul>

Page 56: SLDS and Lightning Components
Page 57: SLDS and Lightning Components

<ul  class="slds-­‐grid">  ...  

<li  class="slds-­‐col">...</li>  <li  class="slds-­‐col  slds-­‐no-­‐flex">...</li>  

...  </ul>

Page 58: SLDS and Lightning Components

<ul  class="slds-­‐grid">  ...  

<li  class="slds-­‐col">...</li>  <li  class="slds-­‐col  slds-­‐no-­‐flex">...</li>  

...  </ul>

Page 59: SLDS and Lightning Components
Page 60: SLDS and Lightning Components

Sizing Helpers Support for 2,3,4,5,6,8, & 12 Column Grids.

Page 61: SLDS and Lightning Components

<...class="slds-­‐size-­‐-­‐1-­‐of-­‐3">  

Page 62: SLDS and Lightning Components

<...class="slds-­‐size-­‐-­‐1-­‐of-­‐3">  

Column span numerator.

Page 63: SLDS and Lightning Components

<...class="slds-­‐size-­‐-­‐1-­‐of-­‐3">  

Human friendly delimiter.

Page 64: SLDS and Lightning Components

<...class="slds-­‐size-­‐-­‐1-­‐of-­‐3">  

Total column denominator.

Page 65: SLDS and Lightning Components

.slds-­‐size-­‐-­‐1-­‐of-­‐3  {  width:  33.3333333333%;  

}                 Output

Page 66: SLDS and Lightning Components

Responsive Sizing Helpers Sizing helpers have responsive technology baked into them

Page 67: SLDS and Lightning Components

/components/utilities/sizing/

Page 68: SLDS and Lightning Components

Mobile first approach

All responsive classes are additive.

Page 69: SLDS and Lightning Components

Breakpoint Names:

x-small = Small phone small = Phone

medium = Tablet large = Desktop

Page 70: SLDS and Lightning Components

<...class="slds-­‐large-­‐size-­‐-­‐1-­‐of-­‐3">  

Page 71: SLDS and Lightning Components

<...class="[default]  [x-­‐small-­‐override]  [small-­‐override]  [medium-­‐override]  [large-­‐override]">

Page 72: SLDS and Lightning Components

<...class="slds-­‐size-­‐-­‐1-­‐of-­‐1  slds-­‐small-­‐size-­‐-­‐1-­‐of-­‐2  slds-­‐medium-­‐size-­‐-­‐1-­‐of-­‐4">

Page 73: SLDS and Lightning Components

100% width up to phone

50% width in between a phone and tablet

25% width on tablet and up (desktop)

Page 74: SLDS and Lightning Components

<div  class="slds-­‐grid  slds-­‐wrap">  

<div  class="slds-­‐size-­‐-­‐1-­‐of-­‐1  slds-­‐small-­‐size-­‐-­‐1-­‐of-­‐2  slds-­‐medium-­‐size-­‐-­‐1-­‐of-­‐4">…</div>  

<div  class="slds-­‐size-­‐-­‐1-­‐of-­‐1  slds-­‐small-­‐size-­‐-­‐1-­‐of-­‐2  slds-­‐medium-­‐size-­‐-­‐1-­‐of-­‐4">…</div>  

<div  class="slds-­‐size-­‐-­‐1-­‐of-­‐1  slds-­‐small-­‐size-­‐-­‐1-­‐of-­‐2  slds-­‐medium-­‐size-­‐-­‐1-­‐of-­‐4">…</div>  

<div  class="slds-­‐size-­‐-­‐1-­‐of-­‐1  slds-­‐small-­‐size-­‐-­‐1-­‐of-­‐2  slds-­‐medium-­‐size-­‐-­‐1-­‐of-­‐4">…</div>  

</div>

Page 75: SLDS and Lightning Components

Mobile:

Page 76: SLDS and Lightning Components

Tablet:

Page 77: SLDS and Lightning Components

Desktop:

Page 78: SLDS and Lightning Components
Page 79: SLDS and Lightning Components

bit.ly/1lJTr3z

Codepen Responsive Grid Example

Page 80: SLDS and Lightning Components

• Lightning Component in Lightning Experience

• Lightning Component in Visualforce

• Lightning Component in a Lightning App

• Lightning Component in Lightning Out

Lightning Components and SLDS

Page 81: SLDS and Lightning Components

Lightning Component in Lightning Experience

<ltng:require />

Page 82: SLDS and Lightning Components

• Lightning Component in Visualforce

• Lightning Component in a Lightning App

• Lightning Component in Lightning Out

Lightning Components and SLDS

<ltng:require styles="/resource/myScope/assets/styles/salesforce-lightning-design-system.css" />

<div class=“myScope”> // your components/markup here </div>

Page 83: SLDS and Lightning Components

• Lightning Component in Visualforce

• Lightning Component in a Lightning App

• Lightning Component in Lightning Out

Lightning Components and SLDS

<ltng:require styles="/resource/myScope/assets/styles/salesforce-lightning-design-system.css" />

<div class=“myScope”> // your components/markup here </div>

Page 84: SLDS and Lightning Components

Scoping SLDS in Lightning Components

https://tools.lightningdesignsystem.com/css-customizer

Page 85: SLDS and Lightning Components

Demo

Page 86: SLDS and Lightning Components

thank y u

Page 87: SLDS and Lightning Components

Go Social!

Salesforce Developers

+Salesforce Developers

Salesforce Developers

Salesforce Developers

@SalesforceDevs

Page 88: SLDS and Lightning Components

developers


Recommended