Skip to content

Commit

Permalink
Merge pull request #80 from UCDavisLibrary/sp-import-fix
Browse files Browse the repository at this point in the history
fix style import for lit elements
  • Loading branch information
jrmerz authored Mar 11, 2021
2 parents e2aedae + 7433dd1 commit 9dcdbe5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { LitElement } from 'lit-element';
import render from "./app-components.tpl.js";
import { sharedStyles } from "../../styles/shared-styles";

import "../../components/graphics/dams-watercolor";
import "../../components/graphics/dams-watercolor-overlay";
Expand All @@ -22,6 +23,10 @@ export default class AppComponents extends LitElement {
};
}

static get styles() {
return [sharedStyles];
}

constructor() {
super();
this.render = render.bind(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { html } from 'lit-element';
import { styles } from "../../styles/shared-styles";
import SharedHtml from '../../utils/shared-html';

export default function render() {
return html`
<style>
${styles()}
:host {
display: block;
background-color: var(--color-white);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import RecordInterface from "../../interfaces/RecordInterface";
import AppStateInterface from "../../interfaces/AppStateInterface";
import CollectionInterface from "../../interfaces/CollectionInterface";

import { sharedStyles } from "../../styles/shared-styles";

/**
* @class AppHome
* @description home page is rendered to the DAMS v2
Expand Down Expand Up @@ -47,6 +49,10 @@ class AppHome extends Mixin(LitElement)
// console.log(this.FcAppConfigModel.getFeaturedImages());
}

static get styles() {
return [sharedStyles];
}

/**
* @method ready
* @description It gets the model information for the Collections when
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { html } from 'lit-element';
import { styles } from "../../styles/shared-styles";
import { classMap } from 'lit-html/directives/class-map';
import { styleMap } from 'lit-html/directives/style-map';

export default function render() {
return html`
<style>
${styles()}
:host {
display: block;
position: relative;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { css, unsafeCSS } from 'lit-element';
import ucdCssProps from "./campus-theme-properties.css";
import ucdCss from "./campus-theme.css";
import damsCssProps from "./dams-styles-properties.css";
Expand All @@ -16,19 +17,4 @@ dmEle.id = 'shared-styles';
dmEle.appendChild(templateEle);
document.head.appendChild(dmEle);

/**
* @function styles
* @description Include this function in your Lit template to include site styles
* <style>
* ${styles()}
* :host {
* display: block;
* }
* </style>
*
* @returns Css string
*/
export default function styles() {
return `${ucdCss + damsCss}`;
}

export const sharedStyles = css`${unsafeCSS(ucdCss + damsCss)}`;

0 comments on commit 9dcdbe5

Please sign in to comment.