@decidables/detectable-elements
Version:
detectable-elements: Web Components for visualizing Signal Detection Theory
157 lines (118 loc) • 2.74 kB
JavaScript
import {css} from 'lit';
import DetectableElement from '../detectable-element';
/*
SDTEquation Base Class - Not intended for instantiation!
<sdt-equation>
*/
export default class SDTEquation extends DetectableElement {
static get properties() {
return {
numeric: {
attribute: 'numeric',
type: Boolean,
reflect: true,
},
};
}
constructor() {
super();
this.numeric = false;
}
static get styles() {
return [
super.styles,
css`
:host {
display: block;
margin: 1rem;
}
/* Containing <div> */
.holder {
display: flex;
flex-direction: row;
justify-content: left;
}
/* Overall <table> */
.equation {
text-align: center;
white-space: nowrap;
border-collapse: collapse;
border: 0;
}
/* Modifies <td> */
.underline {
border-bottom: 1px solid var(---color-text);
}
/* Basic <span> and <var> w/modifiers */
span,
var {
padding: 0 0.25rem;
font-style: normal;
}
var {
border-radius: var(---border-radius);
}
.tight {
padding: 0;
}
.paren {
font-size: 150%;
}
.bracket {
font-size: 175%;
}
.exp {
font-size: 0.75rem;
}
/* Input wrapping <label> */
decidables-spinner {
--decidables-spinner-input-width: 4rem;
display: inline-block;
padding: 0.125rem 0.375rem 0.375rem;
vertical-align: middle;
border-radius: var(---border-radius);
}
.bottom {
vertical-align: bottom;
}
/* Color scheme */
.h {
background: var(---color-h-light);
}
.m {
background: var(---color-m-light);
}
.hr {
background: var(---color-hr-light);
}
.fa {
background: var(---color-fa-light);
}
.ppv {
background: var(---color-present-light);
}
.fomr {
background: var(---color-absent-light);
}
.acc {
background: var(---color-acc-light);
}
.cr {
background: var(---color-cr-light);
}
.far {
background: var(---color-far-light);
}
.d {
background: var(---color-d-light);
}
.c {
background: var(---color-c-light);
}
.s {
background: var(---color-s-light);
}
`,
];
}
}