This article will help you to know about how to use Style and Refer it on Lightning Component app,
Step 1: Create a lightning component.
Step 2: Double click on "Style" from the side bar.
Step 3: Clear the existing code and Paste the below code.
Step 1: Create a lightning component.
Step 2: Double click on "Style" from the side bar.
Step 3: Clear the existing code and Paste the below code.
- .THIS.textStyleMaker {
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
- border: none;
- font: normal 76px/2 "Aclonica", Helvetica, sans-serif;
- color: #0096ff;
- text-align: center;
- -o-text-overflow: ellipsis;
- text-overflow: ellipsis;
- background: -webkit-repeating-radial-gradient(circle closest-side, rgba(255,255,255,1) 0, rgba(243,243,243,1) 50%, rgba(237,237,237,1) 97%,rgba(255,255,255,1) 100%);
- background: -moz-repeating-radial-gradient(circle closest-side, rgba(255,255,255,1) 0, rgba(243,243,243,1) 50%, rgba(237,237,237,1) 97%,rgba(255,255,255,1) 100%);
- background: repeating-radial-gradient(circle closest-side, rgba(255,255,255,1) 0, rgba(243,243,243,1) 50%, rgba(237,237,237,1) 97%,rgba(255,255,255,1) 100%);
- background-position: 50% 50%;
- -webkit-background-origin: padding-box;
- background-origin: padding-box;
- -webkit-background-clip: border-box;
- background-clip: border-box;
- -webkit-background-size: auto auto;
- background-size: auto auto;
- }
Note: CSS selector must begin with '.cStyleComponentWithImage' or '.THIS'
Where "StyleComponentWithImage" is my component name.
Step 4: Refer the above css style in component like below.
- <aura:component >
- <div class="textStyleMaker">Lightning World</div>
- <br/>
- <center>
- <img src="https://developer.salesforce.com/resource/images/trailhead/badges/modules/trailhead_module_lightning_experience_basics.png"/>
- </center>
- </aura:component
Output:
No comments:
Post a Comment