carbon-custom-elements
Version:
A Carbon Design System variant that's as easy to use as native HTML elements, with no framework tax, no framework silo.
13 lines (12 loc) • 15.5 kB
JavaScript
/**
* @license
*
* Copyright IBM Corp. 2019, 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { css } from 'lit-element';
export default css([
"a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}button,input,select,textarea{border-radius:0;font-family:inherit}input[type=text]::-ms-clear{display:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section{display:block}body{line-height:1}sup{vertical-align:super}sub{vertical-align:sub}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-collapse:collapse;border-spacing:0}*{box-sizing:border-box}button{margin:0}html{font-size:100%}body{font-weight:400;font-family:'IBM Plex Sans','Helvetica Neue',Arial,sans-serif;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:'IBM Plex Mono',Menlo,'DejaVu Sans Mono','Bitstream Vera Sans Mono',Courier,monospace}strong{font-weight:600}@media screen and (-ms-high-contrast:active){svg{fill:ButtonText}}h1{font-size:var(--cds-productive-heading-06-font-size,2.625rem);font-weight:var(--cds-productive-heading-06-font-weight,300);line-height:var(--cds-productive-heading-06-line-height,3.125rem);letter-spacing:var(--cds-productive-heading-06-letter-spacing,0)}h2{font-size:var(--cds-productive-heading-05-font-size,2rem);font-weight:var(--cds-productive-heading-05-font-weight,400);line-height:var(--cds-productive-heading-05-line-height,2.5rem);letter-spacing:var(--cds-productive-heading-05-letter-spacing,0)}h3{font-size:var(--cds-productive-heading-04-font-size,1.75rem);font-weight:var(--cds-productive-heading-04-font-weight,400);line-height:var(--cds-productive-heading-04-line-height,2.25rem);letter-spacing:var(--cds-productive-heading-04-letter-spacing,0)}h4{font-size:var(--cds-productive-heading-03-font-size,1.25rem);font-weight:var(--cds-productive-heading-03-font-weight,400);line-height:var(--cds-productive-heading-03-line-height,1.75rem);letter-spacing:var(--cds-productive-heading-03-letter-spacing,0)}h5{font-size:var(--cds-productive-heading-02-font-size,1rem);font-weight:var(--cds-productive-heading-02-font-weight,600);line-height:var(--cds-productive-heading-02-line-height,1.375rem);letter-spacing:var(--cds-productive-heading-02-letter-spacing,0)}h6{font-size:var(--cds-productive-heading-01-font-size,.875rem);font-weight:var(--cds-productive-heading-01-font-weight,600);line-height:var(--cds-productive-heading-01-line-height,1.125rem);letter-spacing:var(--cds-productive-heading-01-letter-spacing,.16px)}p{font-size:var(--cds-body-long-02-font-size,1rem);font-weight:var(--cds-body-long-02-font-weight,400);line-height:var(--cds-body-long-02-line-height,1.5rem);letter-spacing:var(--cds-body-long-02-letter-spacing,0)}a{color:#0062ff}em{font-style:italic}.bx--assistive-text,.bx--visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0;visibility:inherit;white-space:nowrap}.bx--body{box-sizing:border-box;margin:0;padding:0;border:0;font-size:100%;font-family:inherit;vertical-align:baseline;font-size:var(--cds-body-short-01-font-size,.875rem);font-weight:var(--cds-body-short-01-font-weight,400);line-height:var(--cds-body-short-01-line-height,1.125rem);letter-spacing:var(--cds-body-short-01-letter-spacing,.16px);color:var(--cds-text-01,#161616);background-color:var(--cds-ui-background,#fff);line-height:1}.bx--body *,.bx--body :after,.bx--body :before{box-sizing:inherit}@-webkit-keyframes skeleton{0%{width:0%;left:0;right:auto;opacity:.3}20%{width:100%;left:0;right:auto;opacity:1}28%{width:100%;left:auto;right:0}51%{width:0%;left:auto;right:0}58%{width:0%;left:auto;right:0}82%{width:100%;left:auto;right:0}83%{width:100%;left:0;right:auto}96%{width:0%;left:0;right:auto}100%{width:0%;left:0;right:auto;opacity:.3}}@keyframes skeleton{0%{width:0%;left:0;right:auto;opacity:.3}20%{width:100%;left:0;right:auto;opacity:1}28%{width:100%;left:auto;right:0}51%{width:0%;left:auto;right:0}58%{width:0%;left:auto;right:0}82%{width:100%;left:auto;right:0}83%{width:100%;left:0;right:auto}96%{width:0%;left:0;right:auto}100%{width:0%;left:0;right:auto;opacity:.3}}.bx--fieldset{box-sizing:border-box;margin:0;padding:0;border:0;font-size:100%;font-family:inherit;vertical-align:baseline;margin-bottom:2rem}.bx--fieldset *,.bx--fieldset :after,.bx--fieldset :before{box-sizing:inherit}.bx--form-item,:host(bx-radio-button),:host(bx-radio-button-skeleton){font-size:var(--cds-body-short-01-font-size,.875rem);font-weight:var(--cds-body-short-01-font-weight,400);line-height:var(--cds-body-short-01-line-height,1.125rem);letter-spacing:var(--cds-body-short-01-letter-spacing,.16px);display:flex;flex-direction:column;flex:1 1 auto;align-items:flex-start}.bx--label{box-sizing:border-box;margin:0;padding:0;border:0;font-size:100%;font-family:inherit;vertical-align:baseline;font-size:var(--cds-label-01-font-size,.75rem);font-weight:var(--cds-label-01-font-weight,400);line-height:var(--cds-label-01-line-height,1rem);letter-spacing:var(--cds-label-01-letter-spacing,.32px);color:var(--cds-text-02,#525252);font-weight:400;display:inline-block;vertical-align:baseline;margin-bottom:.5rem;line-height:1rem}.bx--label *,.bx--label :after,.bx--label :before{box-sizing:inherit}.bx--label .bx--tooltip__trigger{font-size:var(--cds-label-01-font-size,.75rem);font-weight:var(--cds-label-01-font-weight,400);line-height:var(--cds-label-01-line-height,1rem);letter-spacing:var(--cds-label-01-letter-spacing,.32px)}.bx--label.bx--skeleton{position:relative;border:none;padding:0;box-shadow:none;pointer-events:none;background:var(--cds-skeleton-01,#e5e5e5);width:4.6875rem;height:.875rem}.bx--label.bx--skeleton:active,.bx--label.bx--skeleton:focus,.bx--label.bx--skeleton:hover{border:none;outline:0;cursor:default}.bx--label.bx--skeleton:before{content:'';width:0%;height:100%;position:absolute;top:0;left:0;background:var(--cds-skeleton-02,#c6c6c6);-webkit-animation:3s ease-in-out skeleton infinite;animation:3s ease-in-out skeleton infinite}@media (prefers-reduced-motion:reduce){.bx--label.bx--skeleton:before{-webkit-animation:none;animation:none}}input[type=number]{font-family:'IBM Plex Mono',Menlo,'DejaVu Sans Mono','Bitstream Vera Sans Mono',Courier,monospace}.bx--combo-box[data-invalid] .bx--text-input,.bx--list-box[data-invalid],.bx--select-input__wrapper[data-invalid],.bx--text-area__wrapper[data-invalid]>.bx--text-area--invalid,.bx--text-input__field-wrapper[data-invalid],input[data-invalid]{outline:2px solid var(--cds-support-01,#da1e28);outline-offset:-2px}.bx--list-box[data-invalid]~.bx--form-requirement,.bx--select-input__wrapper[data-invalid]~.bx--form-requirement,.bx--text-area__wrapper[data-invalid]~.bx--form-requirement,.bx--text-input__field-wrapper[data-invalid]~.bx--form-requirement,.bx--time-picker[data-invalid]~.bx--form-requirement,input[data-invalid]~.bx--form-requirement{max-height:12.5rem;display:block;color:var(--cds-text-error,#da1e28)}.bx--form--fluid .bx--text-input__field-wrapper[data-invalid]{display:block}.bx--form--fluid .bx--fieldset{margin:0}.bx--form--fluid input[data-invalid]{outline:0}.bx--form--fluid .bx--form-requirement{margin:0;padding:.5rem 2.5rem .5rem 1rem}input:not(output):not([data-invalid]):-moz-ui-invalid{box-shadow:none}.bx--form-requirement{box-sizing:border-box;margin:0;padding:0;border:0;font-size:100%;font-family:inherit;vertical-align:baseline;font-size:var(--cds-caption-01-font-size,.75rem);font-weight:var(--cds-caption-01-font-weight,400);line-height:var(--cds-caption-01-line-height,1rem);letter-spacing:var(--cds-caption-01-letter-spacing,.32px);margin:.25rem 0 0;max-height:0;overflow:hidden;display:none}.bx--form-requirement *,.bx--form-requirement :after,.bx--form-requirement :before{box-sizing:inherit}.bx--select--inline .bx--form__helper-text{margin-top:0}.bx--form__helper-text{font-size:var(--cds-helper-text-01-font-size,.75rem);line-height:var(--cds-helper-text-01-line-height,1rem);letter-spacing:var(--cds-helper-text-01-letter-spacing,.32px);color:var(--cds-text-02,#525252);z-index:0;opacity:1;margin-top:.25rem}.bx--form__helper-text--disabled,.bx--label--disabled{color:var(--cds-disabled-02,#c6c6c6)}.bx--radio-button-group,:host(bx-radio-button-group){display:flex;align-items:center;margin-top:.375rem}.bx--label+.bx--form-item .bx--radio-button-group,.bx--label+.bx--form-item :host(bx-radio-button-group),.bx--label+:host(bx-radio-button) .bx--radio-button-group,.bx--label+:host(bx-radio-button) :host(bx-radio-button-group),.bx--label+:host(bx-radio-button-skeleton) .bx--radio-button-group,.bx--label+:host(bx-radio-button-skeleton) :host(bx-radio-button-group){margin-top:0}.bx--radio-button-group--vertical,:host(bx-radio-button-group[orientation=vertical]){flex-direction:column;align-items:flex-start}.bx--radio-button-group--vertical.bx--radio-button-group--label-left,:host(:host(bx-radio-button-group[orientation=vertical]bx-radio-button-group[label-position=left])),:host(bx-radio-button-group[label-position=left].bx--radio-button-group--vertical),:host(bx-radio-button-group[orientation=vertical].bx--radio-button-group--label-left){align-items:flex-end}.bx--radio-button-group--vertical .bx--radio-button__label,:host(bx-radio-button-group[orientation=vertical]) .bx--radio-button__label{margin-right:0;line-height:1.25rem}.bx--radio-button-group--vertical .bx--radio-button__label:not(:last-of-type),:host(bx-radio-button-group[orientation=vertical]) .bx--radio-button__label:not(:last-of-type){margin-bottom:.5rem}.bx--radio-button{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0;visibility:inherit;white-space:nowrap;visibility:inherit}.bx--radio-button__label{font-size:var(--cds-body-short-01-font-size,.875rem);font-weight:var(--cds-body-short-01-font-weight,400);line-height:var(--cds-body-short-01-line-height,1.125rem);letter-spacing:var(--cds-body-short-01-letter-spacing,.16px);display:flex;align-items:center;cursor:pointer;margin-right:1rem}.bx--radio-button__appearance{box-sizing:border-box;margin:0;padding:0;border:0;font-size:100%;font-family:inherit;vertical-align:baseline;background-color:transparent;border-radius:50%;border:1px solid var(--cds-icon-01,#161616);flex-shrink:0;height:1.125rem;width:1.125rem;margin-right:.5rem}.bx--radio-button__appearance *,.bx--radio-button__appearance :after,.bx--radio-button__appearance :before{box-sizing:inherit}.bx--radio-button:checked+.bx--radio-button__label .bx--radio-button__appearance{display:flex;align-items:center;justify-content:center;border-color:var(--cds-icon-01,#161616)}.bx--radio-button:checked+.bx--radio-button__label .bx--radio-button__appearance:before{content:'';display:inline-block;position:relative;width:100%;height:100%;border-radius:50%;background-color:var(--cds-icon-01,#161616);-webkit-transform:scale(.5);transform:scale(.5)}@media screen and (-ms-high-contrast:active){.bx--radio-button:checked+.bx--radio-button__label .bx--radio-button__appearance:before{background-color:windowText}}[disabled]~_{font-size:inherit}.bx--radio-button:disabled+.bx--radio-button__label{color:var(--cds-disabled-02,#c6c6c6);cursor:not-allowed}.bx--radio-button:disabled+.bx--radio-button__label .bx--radio-button__appearance,.bx--radio-button:disabled:checked+.bx--radio-button__label .bx--radio-button__appearance{border-color:var(--cds-disabled-02,#c6c6c6)}.bx--radio-button:disabled+.bx--radio-button__label .bx--radio-button__appearance::before,.bx--radio-button:disabled:checked+.bx--radio-button__label .bx--radio-button__appearance::before{background-color:var(--cds-disabled-02,#c6c6c6)}.bx--radio-button:focus+.bx--radio-button__label .bx--radio-button__appearance{box-shadow:0 0 0 2px var(--cds-focus,#0f62fe);outline:1px solid transparent}.bx--radio-button__label.bx--skeleton{position:relative;border:none;padding:0;box-shadow:none;pointer-events:none;background:var(--cds-skeleton-01,#e5e5e5);width:6.25rem;height:1.125rem}.bx--radio-button__label.bx--skeleton:active,.bx--radio-button__label.bx--skeleton:focus,.bx--radio-button__label.bx--skeleton:hover{border:none;outline:0;cursor:default}.bx--radio-button__label.bx--skeleton:before{content:'';width:0%;height:100%;position:absolute;top:0;left:0;background:var(--cds-skeleton-02,#c6c6c6);-webkit-animation:3s ease-in-out skeleton infinite;animation:3s ease-in-out skeleton infinite}@media (prefers-reduced-motion:reduce){.bx--radio-button__label.bx--skeleton:before{-webkit-animation:none;animation:none}}.bx--radio-button__label.bx--skeleton .bx--radio-button__appearance{display:none}.bx--radio-button-wrapper .bx--radio-button__label,:host(bx-radio-button) .bx--radio-button__label{display:flex;align-items:center;justify-content:center;margin:0}.bx--radio-button-wrapper:not(:last-of-type),:host(bx-radio-button:not(:last-of-type)){margin-right:1rem}.bx--radio-button-group--vertical .bx--radio-button-wrapper:not(:last-of-type),.bx--radio-button-group--vertical :host(bx-radio-button:not(:last-of-type)),:host(bx-radio-button-group[orientation=vertical]) .bx--radio-button-wrapper:not(:last-of-type),:host(bx-radio-button-group[orientation=vertical]) :host(bx-radio-button:not(:last-of-type)){margin-right:0;margin-bottom:.5rem}.bx--radio-button-group--label-right .bx--radio-button__label,.bx--radio-button-wrapper.bx--radio-button-wrapper--label-right .bx--radio-button__label,:host(bx-radio-button.bx--radio-button-wrapper--label-right) .bx--radio-button__label{flex-direction:row}.bx--radio-button-group--label-left .bx--radio-button__label,.bx--radio-button-wrapper.bx--radio-button-wrapper--label-left .bx--radio-button__label,:host(bx-radio-button-group[label-position=left]) .bx--radio-button__label,:host(bx-radio-button.bx--radio-button-wrapper--label-left) .bx--radio-button__label{flex-direction:row-reverse}.bx--radio-button-group--label-left .bx--radio-button__appearance,.bx--radio-button-wrapper.bx--radio-button-wrapper--label-left .bx--radio-button__appearance,:host(bx-radio-button-group[label-position=left]) .bx--radio-button__appearance,:host(bx-radio-button.bx--radio-button-wrapper--label-left) .bx--radio-button__appearance{margin-right:0;margin-left:.5rem}:host(bx-radio-button){outline:0}:host(bx-radio-button) .bx--radio-button__label{flex-direction:row}:host(bx-radio-button[disabled]) .bx--radio-button__label{color:var(--cds-disabled-02,#c6c6c6);cursor:not-allowed}:host(bx-radio-button[disabled]) .bx--radio-button__appearance{border-color:var(--cds-disabled-02,#c6c6c6)}:host(bx-radio-button[disabled]) .bx--radio-button__appearance::before{background-color:var(--cds-disabled-02,#c6c6c6)}:host(bx-radio-button[label-position=left]) .bx--radio-button__label{flex-direction:row-reverse}:host(bx-radio-button[label-position=left]) .bx--radio-button__appearance{margin-right:0;margin-left:.5rem}",
]);