| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
| layout | layout-docs.njk | |
|---|---|---|
| title | Write your CSS | |
| order | 50 | |
| tags |
|
{% band %}
We want the pf-cool-element to have a profile photo, a username, and a follow button. Right now, it only contains the HTML structure, but we can style our element by updating our CSS to make it look the way we want.
We'll be working in the pf-cool-element.css file.
The boilerplate stylesheet has a :host selector that makes our element display as a block element.
:host {
display: block;
}Now we can update our styles, like so:
:host {
display: inline-flex;
flex-direction: column;
align-items: center;
justify-content: center;
border:
var(--pf-global--BorderWidth--sm, 1px)
solid
var(--pf-global--BorderColor--100, #d2d2d2);
padding: var(--pf-global--spacer--xl, 2rem);
margin: var(--pf-global--spacer--md, 1rem);
}
:host([hidden]) {
display: none;
}
#profile-pic {
width: 60px;
height: 60px;
margin: var(--pf-global--spacer--md, 1rem);
border:
var(--pf-global--BorderWidth--sm, 1px)
solid
var(--pf-global--BorderColor--200, #8a8d90);
border-radius: 50%;
background-color: var(--pf-global--BackgroundColor--200, #f0f0f0);
}After saving and viewing our demo page, our profile element looks much better.
A couple of things to note:
Now that our pf-cool-element is more appealing, we'll add the follow button's interaction and fill in the profile photo. We can accomplish both of these tasks by updating the pf-cool-element.ts file.
Next up: Write your JavaScript
{% endband %}
| Back | FazBrowse Home | New Git URL |