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) • 13.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: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}.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%;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,:host(bx-checkbox){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--form-item.bx--checkbox-wrapper,:host(bx-checkbox){margin-bottom:.25rem}.bx--form-item.bx--checkbox-wrapper:first-of-type,:host(bx-checkbox:first-of-type){margin-top:.1875rem}.bx--label+.bx--form-item.bx--checkbox-wrapper,.bx--label+:host(bx-checkbox){margin-top:-.125rem}.bx--form-item.bx--checkbox-wrapper:last-of-type,:host(bx-checkbox:last-of-type){margin-bottom:.1875rem}.bx--checkbox{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--checkbox-label{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);line-height:1.5rem;position:relative;display:flex;cursor:pointer;min-height:1.5rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding-right:1.25rem}.bx--checkbox-label *,.bx--checkbox-label ::after,.bx--checkbox-label ::before{box-sizing:inherit}.bx--checkbox-label-text{padding-right:.375rem}.bx--checkbox-label::after,.bx--checkbox-label::before{box-sizing:border-box}.bx--checkbox-label::before{content:'';width:1rem;height:1rem;margin:.125rem;position:absolute;right:0;top:.125rem;background-color:transparent;border:1px solid var(--cds-ui-05,#161616);border-radius:1px}.bx--checkbox-label::after{content:'';position:absolute;right:.375rem;top:.5rem;width:.5625rem;height:.3125rem;background:0 0;border-right:2px solid var(--cds-inverse-01,#fff);border-bottom:2px solid var(--cds-inverse-01,#fff);-webkit-transform:scale(0) rotate(45deg);transform:scale(0) rotate(45deg);-webkit-transform-origin:bottom left;transform-origin:bottom left;margin-top:-.1875rem}.bx--checkbox-label[data-contained-checkbox-state=mixed]::before,.bx--checkbox-label[data-contained-checkbox-state=true]::before,.bx--checkbox:checked+.bx--checkbox-label::before,.bx--checkbox:indeterminate+.bx--checkbox-label::before{background-color:var(--cds-ui-05,#161616);border-color:var(--cds-ui-05,#161616);border-width:1px}.bx--checkbox-label[data-contained-checkbox-state=true]::after,.bx--checkbox:checked+.bx--checkbox-label::after{-webkit-transform:scale(1) rotate(45deg);transform:scale(1) rotate(45deg)}.bx--checkbox-label[data-contained-checkbox-state=mixed]::after,.bx--checkbox:indeterminate+.bx--checkbox-label::after{-webkit-transform:scale(1) rotate(0);transform:scale(1) rotate(0);border-right:0 solid var(--cds-inverse-01,#fff);border-bottom:2px solid var(--cds-inverse-01,#fff);width:.5rem;top:.6875rem}.bx--checkbox-label[data-contained-checkbox-state=mixed].bx--checkbox-label__focus::before,.bx--checkbox-label[data-contained-checkbox-state=true].bx--checkbox-label__focus::before,.bx--checkbox-label__focus::before,.bx--checkbox:checked:focus+.bx--checkbox-label::before,.bx--checkbox:focus+.bx--checkbox-label::before,.bx--checkbox:indeterminate:focus+.bx--checkbox-label::before{box-shadow:0 0 0 2px var(--cds-inverse-01,#fff),0 0 0 4px var(--cds-focus,#0f62fe)}.bx--checkbox-label[data-contained-checkbox-disabled=true],.bx--checkbox:disabled+.bx--checkbox-label{cursor:not-allowed;color:var(--cds-disabled-02,#c6c6c6)}.bx--checkbox-label[data-contained-checkbox-disabled=true]::before,.bx--checkbox:disabled+.bx--checkbox-label::before{border-color:var(--cds-disabled-02,#c6c6c6)}.bx--checkbox-label[data-contained-checkbox-state=mixed][data-contained-checkbox-disabled=true]::before,.bx--checkbox-label[data-contained-checkbox-state=true][data-contained-checkbox-disabled=true]::before,.bx--checkbox:checked:disabled+.bx--checkbox-label::before,.bx--checkbox:indeterminate:disabled+.bx--checkbox-label::before{background-color:var(--cds-disabled-02,#c6c6c6)}.bx--checkbox-label-text.bx--skeleton{position:relative;border:none;padding:0;box-shadow:none;pointer-events:none;background:var(--cds-skeleton-01,#e5e5e5);width:6.25rem;height:var(--cds-spacing-05,1rem);margin:auto .375rem auto 0}.bx--checkbox-label-text.bx--skeleton:active,.bx--checkbox-label-text.bx--skeleton:focus,.bx--checkbox-label-text.bx--skeleton:hover{border:none;outline:0;cursor:default}.bx--checkbox-label-text.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--checkbox-label-text.bx--skeleton::before{-webkit-animation:none;animation:none}}:host(bx-checkbox){outline:0}",
]);