Skip to content
Snippets Groups Projects
paragraph-text.tsx 929 B
Newer Older
  • Learn to ignore specific revisions
  • import {Component, Element, h, Host, Prop} from '@stencil/core';
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    
    @Component({
      tag: 'hy-paragraph-text',
    
      styleUrls: {
        default: 'paragraph-text.scss',
        content: 'paragraph-text-content.scss',
        landing: 'paragraph-text-landing.scss',
      },
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    })
    export class ParagraphText {
    
      @Prop() headerstyle: string = 'default';
      @Element() el: HTMLElement;
    
      componentDidLoad() {
        let hyMainDiv = this.el.closest('.hy-main');
        if (hyMainDiv) {
          if (!hyMainDiv.classList.contains('with-sidebar')) {
            this.headerstyle = 'wide';
          }
        }
      }
    
    
    Markus Kaarto's avatar
    Markus Kaarto committed
      render() {
    
        const classAttributes = ['hy-paragraph-text', `${this.variant}`, `${this.placement}`, `${this.headerstyle}`].join(
          ' '
        );
    
    Markus Kaarto's avatar
    Markus Kaarto committed
        return (
    
    Markus Kaarto's avatar
    Markus Kaarto committed
        );
      }
    }