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) • 12 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:inherit;font-size:100%;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:''}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}@-webkit-keyframes skeleton{0%{width:0%;right:0;left:auto;opacity:.3}20%{width:100%;right:0;left:auto;opacity:1}28%{width:100%;right:auto;left:0}51%{width:0%;right:auto;left:0}58%{width:0%;right:auto;left:0}82%{width:100%;right:auto;left:0}83%{width:100%;right:0;left:auto}96%{width:0%;right:0;left:auto}100%{width:0%;right:0;left:auto;opacity:.3}}@keyframes skeleton{0%{width:0%;right:0;left:auto;opacity:.3}20%{width:100%;right:0;left:auto;opacity:1}28%{width:100%;right:auto;left:0}51%{width:0%;right:auto;left:0}58%{width:0%;right:auto;left:0}82%{width:100%;right:auto;left:0}83%{width:100%;right:0;left:auto}96%{width:0%;right:0;left:auto}100%{width:0%;right:0;left: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{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;right: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 1rem .5rem 2.5rem}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;width:100%}.bx--form__helper-text--disabled,.bx--label--disabled{color:var(--cds-disabled-02,#c6c6c6)}.bx--text-area{box-sizing:border-box;margin:0;padding:0;border:0;font-size:100%;font-family:inherit;vertical-align:baseline;font-size:var(--cds-body-long-01-font-size,.875rem);font-weight:var(--cds-body-long-01-font-weight,400);line-height:var(--cds-body-long-01-line-height,1.25rem);letter-spacing:var(--cds-body-long-01-letter-spacing,.16px);outline:2px solid transparent;outline-offset:-2px;background-color:var(--cds-field-01,#f4f4f4);width:100%;height:100%;min-width:10rem;min-height:2.5rem;padding:.6875rem 1rem;color:var(--cds-text-01,#161616);resize:vertical;border:none;border-bottom:1px solid var(--cds-ui-04,#8d8d8d);transition:background-color 70ms cubic-bezier(.2,0,.38,.9),outline 70ms cubic-bezier(.2,0,.38,.9)}.bx--text-area *,.bx--text-area ::after,.bx--text-area ::before{box-sizing:inherit}.bx--text-area:active,.bx--text-area:focus{outline:2px solid var(--cds-focus,#0f62fe);outline-offset:-2px}.bx--text-area::-webkit-input-placeholder{color:var(--cds-text-03,#a8a8a8);font-size:var(--cds-body-long-01-font-size,.875rem);font-weight:var(--cds-body-long-01-font-weight,400);line-height:var(--cds-body-long-01-line-height,1.25rem);letter-spacing:var(--cds-body-long-01-letter-spacing,.16px);opacity:1}.bx--text-area:-ms-input-placeholder{color:var(--cds-text-03,#a8a8a8);font-size:var(--cds-body-long-01-font-size,.875rem);font-weight:var(--cds-body-long-01-font-weight,400);line-height:var(--cds-body-long-01-line-height,1.25rem);letter-spacing:var(--cds-body-long-01-letter-spacing,.16px);opacity:1}.bx--text-area::-ms-input-placeholder{color:var(--cds-text-03,#a8a8a8);font-size:var(--cds-body-long-01-font-size,.875rem);font-weight:var(--cds-body-long-01-font-weight,400);line-height:var(--cds-body-long-01-line-height,1.25rem);letter-spacing:var(--cds-body-long-01-letter-spacing,.16px);opacity:1}.bx--text-area::placeholder{color:var(--cds-text-03,#a8a8a8);font-size:var(--cds-body-long-01-font-size,.875rem);font-weight:var(--cds-body-long-01-font-weight,400);line-height:var(--cds-body-long-01-line-height,1.25rem);letter-spacing:var(--cds-body-long-01-letter-spacing,.16px);opacity:1}.bx--text-area--light{background-color:var(--cds-field-02,#fff)}.bx--text-area--invalid{padding-left:2.5rem}.bx--text-area__wrapper{position:relative;display:flex;width:100%}.bx--text-area__invalid-icon{position:absolute;left:1rem;top:.75rem;fill:var(--cds-support-01,#da1e28)}.bx--text-area:disabled{cursor:not-allowed;outline:0;background-color:var(--cds-disabled-01,#f4f4f4);border-bottom:1px solid transparent;color:var(--cds-disabled-02,#c6c6c6)}.bx--text-area:disabled::-webkit-input-placeholder{color:var(--cds-disabled-02,#c6c6c6)}.bx--text-area:disabled:-ms-input-placeholder{color:var(--cds-disabled-02,#c6c6c6)}.bx--text-area:disabled::-ms-input-placeholder{color:var(--cds-disabled-02,#c6c6c6)}.bx--text-area:disabled::placeholder{color:var(--cds-disabled-02,#c6c6c6)}.bx--text-area.bx--text-area--light:disabled{background-color:var(--cds-field-02,#fff)}bx--text-area.bx--skeleton{position:relative;border:none;padding:0;box-shadow:none;pointer-events:none;background:var(--cds-skeleton-01,#e5e5e5);height:6.25rem}bx--text-area.bx--skeleton:active,bx--text-area.bx--skeleton:focus,bx--text-area.bx--skeleton:hover{border:none;outline:0;cursor:default}bx--text-area.bx--skeleton::before{content:'';width:0%;height:100%;position:absolute;top:0;right: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--text-area.bx--skeleton::before{-webkit-animation:none;animation:none}}bx--text-area.bx--skeleton::-webkit-input-placeholder{color:transparent}bx--text-area.bx--skeleton:-ms-input-placeholder{color:transparent}bx--text-area.bx--skeleton::-ms-input-placeholder{color:transparent}bx--text-area.bx--skeleton::placeholder{color:transparent}:host(bx-textarea){outline:0}",
]);