Skip to content

How to Style the components #1126

Answered by jorenbroekema
lpoulter asked this question in Q&A
Discussion options

You must be logged in to vote

Hi!

The main idea about Lion is that you should extend the component classes.

There's an example here:
https://lion-web-components.netlify.app/?path=/docs/intro-announcement--page#-extend-the-components

Essentially we don't really expect people to use for example lion-input directly. You can, but the styling options will be limited, as we don't currently do anything special for CSS features like ::theme or ::part.

The recommended way to use lion, in another example:

import { css } from '@lion/core';
import { LionInput } from '@lion/input';

export class FooInput extends LionInput {
  static get styles() {
    return [
      super.styles,
      css`
        /* your styles here */
      `
    

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@jorenbroekema
Comment options

@abdonrd
Comment options

Answer selected by lpoulter
Comment options

You must be logged in to vote
2 replies
@jorenbroekema
Comment options

@lpoulter
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants