block in a lightning:card component with the following
attributes:
+ title: Filter Students
+ iconNvame: utity:search
6. Save the file and refresh the application in Lightning Experience. Verify
that the heading text is now on a white backaround.
Use SLDS to Add Margin to a Component
7. Open https:/llightningdesignsystem.com! in your browser.
8. Select Utilities | Margin
9. Review the examples for Bottom margin
410. Open StudentBrowser.cmp in Developer Console.
11. Wrap the tag in a
block with the
following attribute
+ class: sids-mbottom smal
12. Save the file and reload the Awinstructors tab. There should now be
visible margin between the Filters Students form and the Gallery tab.
Use SLDS to Apply Padding within a Component
13. Open https:/ightningdesignsystem.comy in your browser.
14, Select Utilities | Padding
15. Review the examples for Hoxizontal padding
16. Return to Developer Console and StudentBrowserForm.cmp
17. Wrap the
block with a
tag that uses the following attribute:
+ class: side p-horizontal_small
18. Save the file and test the application. The heading text should no
longer be placed against the left edge of the component.
Apply Custom CSS
19. Return to Developer Console and StudentBrowserForm.cmp
20. Add the following attribute to the
Running this code results in the following output:
202-4
2000 ~ 2000
24 mull = 2
Using Arithmetic Operators
Expressions based on arithmetic operators result in numerical values. The
standard operators of +.-,*/,%, and are all supported, as illustrated by
the following component:
aura: component
soura:attribute name-"numl"
yame="nam2"
type:
default
Passing in attribute values of num1=2 and num2=4 into the component
generates the following output:
+4
-4
a4
v4
a4
gat.
ENN
iegative 2
Using Math Functions
Section 2
‘The following math functions are supported. Note that all function names
are case-sensitive:
ees oneareomd
add concat add(1.2) +
sub subtract sub(10.2) -
mult multiply mult(10,2) .
div divide div(4,2) \
mod modulus moa(s,2) %
abs abs(-1)
neg negate neg(100) ~(unary)
For example: