diff --git a/components/css/main.css b/components/css/main.css index 670b75c..2d0cbd1 100644 --- a/components/css/main.css +++ b/components/css/main.css @@ -331,114 +331,6 @@ ul { margin-left: 0.5rem; } -.token.comment, -.token.block-comment, -.token.prolog, -.token.doctype, -.token.cdata { - color: #50cb93; -} - -.token.punctuation, -.token.tag { - color: #29b6f6; -} - -.token.attr-name, -.token.namespace, -.token.deleted { - color: #1de9b6; -} - -.token.function-name { - color: #6196cc; -} - -.token.boolean, -.token.number, -.token.function { - color: #f08d49; -} - -.token.property, -.token.class-name, -.token.constant, -.token.symbol { - color: #f8c555; -} - -.token.selector, -.token.important, -.token.atrule, -.token.keyword, -.token.builtin { - color: #ff6767; -} - -.token.string, -.token.char, -.token.attr-value, -.token.regex, -.token.variable { - color: #84ffff; -} - -.token.operator, -.token.entity, -.token.url { - color: #67cdcc; -} - -.token.important, -.token.bold { - font-weight: bold; -} - -.token.italic { - font-style: italic; -} - -.token.entity { - cursor: help; -} - -.token.inserted { - color: green; -} - -pre { - max-width: 100%; - margin: 1rem 0; - padding: 0 1.5rem; - overflow-x: auto; - font-size: 0.9rem; - font-weight: 500; - white-space: pre; - border-radius: 0.5rem; - background: rgba(0, 0, 0, 0.9); - line-height: 1.7; -} - -code { - border-radius: 0.3rem; - font-weight: 400; - padding: 0.2rem 0.4rem; - background: rgba(var(--text-color), 0.1); - color: rgba(255, 255, 255, 0.9); -} - -code * { - color: rgba(255, 255, 255, 0.9); - font-family: "Roboto Mono", monospace; -} - -pre code { - line-height: 1.4; - border-radius: none; - background: none; - width: 100%; -} - h1, h2, h3, diff --git a/components/css/main.min.css b/components/css/main.min.css index 21c25b7..6c7e175 100644 --- a/components/css/main.min.css +++ b/components/css/main.min.css @@ -1 +1 @@ -*{padding:0;margin:0;box-sizing:border-box;font-family:"Roboto",sans-serif}:root{font-size:clamp(1rem,1.2vmax,1.2rem)}html,body{height:100%}body{--accent-color: #0d7377;--secondary-color: #ffac2e;--text-color: 20, 20, 20;--foreground-color: 252, 253, 255;--background-color: 241, 243, 248;--danger-color: rgb(255, 75, 75);--green: #1cad59;--yellow: rgb(220, 165, 0);color:rgba(var(--text-color), 1);background-color:rgba(var(--background-color), 1);overflow-y:hidden}body[data-theme=dark]{--accent-color: #32e0c4;--secondary-color: #d60739;--text-color: 220, 220, 220;--foreground-color: 27, 28, 29;--background-color: 21, 22, 22;--danger-color: rgb(255, 106, 106);--green: #00e676;--yellow: rgb(255, 213, 5)}p,strong{font-size:.9rem;max-width:65ch;line-height:1.7;color:rgba(var(--text-color), 0.9)}img{-o-object-fit:cover;object-fit:cover}a{color:inherit;text-decoration:none}a:focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}button{display:inline-flex;border:none;background-color:inherit}a:-webkit-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:-moz-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}sm-button{--border-radius: 0.3rem}ul{list-style:none}.table{display:grid;gap:.5rem;margin:1rem 0;position:relative;text-align:left;overflow-x:auto;border-radius:.3rem;border-collapse:separate;border-spacing:1rem 1.5rem;background-color:rgba(var(--text-color), 0.04)}.table p:only-of-type{margin-bottom:0}.tr{display:grid;gap:1rem;padding:1rem;grid-template-columns:11rem 1fr;width:100%}.tr:nth-of-type(odd){background-color:rgba(var(--text-color), 0.04)}.tr p{min-width:30ch}.flex{display:flex}.grid{display:grid}.hide{opacity:0;pointer-events:none}.hide-completely{display:none !important}.no-transformations{transform:none !important}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.breakable{overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-word;-webkit-hyphens:auto;hyphens:auto}.full-bleed{grid-column:1/4}.h1{font-size:2.5rem}.h2{font-size:2rem}.h3{font-size:1.4rem}.h4{font-size:1rem}.h5{font-size:.8rem}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.flex{display:flex}.grid{display:grid}.grid-3{grid-template-columns:1fr auto auto}.flow-column{grid-auto-flow:column}.gap-0-5{gap:.5rem}.gap-1{gap:1rem}.gap-1-5{gap:1.5rem}.gap-2{gap:2rem}.gap-3{gap:3rem}.text-align-right{text-align:right}.align-start{align-items:flex-start}.align-center{align-items:center}.text-center{text-align:center}.justify-start{justify-content:start}.justify-center{justify-content:center}.justify-right{margin-left:auto}.align-self-center{align-self:center}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.direction-column{flex-direction:column}.space-between{justify-content:space-between}.w-100{width:100%}.color-0-8{color:rgba(var(--text-color), 0.8)}.weight-400{font-weight:400}.weight-500{font-weight:500}.ripple{height:8rem;width:8rem;position:absolute;border-radius:50%;transform:scale(0);background:radial-gradient(circle, rgba(var(--text-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%);pointer-events:none}.interact{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.observe-empty-state:empty{display:none}.observe-empty-state:not(:empty)~.empty-state{display:none}.icon{width:1.5rem;height:1.5rem;fill:rgba(var(--text-color), 0.9)}.button__icon{height:1.2rem;width:1.2rem}.button__icon--left{margin-right:.5rem}.button__icon--right{margin-left:.5rem}.token.comment,.token.block-comment,.token.prolog,.token.doctype,.token.cdata{color:#50cb93}.token.punctuation,.token.tag{color:#29b6f6}.token.attr-name,.token.namespace,.token.deleted{color:#1de9b6}.token.function-name{color:#6196cc}.token.boolean,.token.number,.token.function{color:#f08d49}.token.property,.token.class-name,.token.constant,.token.symbol{color:#f8c555}.token.selector,.token.important,.token.atrule,.token.keyword,.token.builtin{color:#ff6767}.token.string,.token.char,.token.attr-value,.token.regex,.token.variable{color:#84ffff}.token.operator,.token.entity,.token.url{color:#67cdcc}.token.important,.token.bold{font-weight:bold}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}pre{max-width:100%;margin:1rem 0;padding:0 1.5rem;overflow-x:auto;font-size:.9rem;font-weight:500;white-space:pre;border-radius:.5rem;background:rgba(0,0,0,.9);line-height:1.7}code{border-radius:.3rem;font-weight:400;padding:.2rem .4rem;background:rgba(var(--text-color), 0.1);color:rgba(255,255,255,.9)}code *{color:rgba(255,255,255,.9);font-family:"Roboto Mono",monospace}pre code{line-height:1.4;border-radius:none;background:none;width:100%}h1,h2,h3,h4.h5{font-family:"Poppins",sans-serif}h2{margin:3rem 0 1rem 0;text-transform:capitalize}main{display:grid;height:100%}#main_header{padding:.5rem 1.5rem;border-bottom:1px solid rgba(var(--text-color), 0.1)}#side_nav_button{padding:.5rem;margin-left:-0.5rem}.right{max-height:100%;overflow-y:auto}#side_nav>:last-child{padding-bottom:3rem}#side_nav h4{font-size:.9rem;letter-spacing:.08em;text-transform:uppercase;padding:1.5rem}.right{padding:1.5rem}.right h1{margin-bottom:1.5rem}.list{list-style:none;display:flex;flex-direction:column;margin-bottom:.8rem}.list__item{display:flex;padding:.8rem 1.5rem;text-transform:capitalize}.list__item--active{color:var(--accent-color);background:rgba(var(--text-color), 0.06)}.card{display:flex;flex-direction:column;margin-right:1rem;border-radius:.4rem;padding:1.5rem;min-width:min(24rem,80%);background-color:rgba(var(--text-color), 0.06)}sm-carousel{margin-bottom:1rem}sm-tab-header{margin-bottom:1.5rem}.page{display:flex;flex-direction:column;padding-bottom:3rem}ol{padding:.6rem 1rem;max-width:75ch;margin-bottom:1.5rem}ol li{margin-bottom:1rem}ol li:last-of-type{margin-bottom:0}strong{max-width:65ch}strong.important{display:flex;padding:.5rem;margin:.5rem 0;border-radius:.3rem;color:rgba(0,0,0,.8);background-color:khaki}.highlight{display:inline-flex;font-family:"Roboto Mono",monospace;background-color:rgba(var(--text-color), 0.1);border-radius:.2rem;padding:.1rem .5rem;font-size:.9rem;line-height:1.6}#total_components_count{font-size:4rem}#components_selection_list{display:grid;gap:1.5rem;grid-template-columns:repeat(auto-fill, minmax(10rem, 1fr));padding:1.5rem 0 3rem 0}.comp-checkbox__title{margin-left:.5rem}.auto-grid-2{justify-content:center;justify-items:center;text-align:center;grid-template-columns:repeat(auto-fill, minmax(18rem, 1fr))}.screenshot{-o-object-fit:cover;object-fit:cover;-o-object-position:top;object-position:top;height:30rem;width:16rem;border-radius:1rem;justify-self:center;box-shadow:0 .5rem 1.5rem -0.5rem rgba(0,0,0,.3),0 0 0 .3rem #000}@media screen and (max-width: 640px){main{grid-template-rows:auto 1fr;grid-template-columns:1fr}}@media screen and (min-width: 640px){sm-popup{--width: 32rem}#main_header{padding:1rem 1.5rem;grid-area:main-header}#side_nav_button{display:none}main{grid-template-columns:14rem minmax(0, 1fr);grid-template-areas:"main-header main-header" ". ."}.right{display:grid;grid-template-columns:1fr 90% 1fr}.right>*{grid-column:2/3}.page__title{font-size:2.5rem}#overview_page{display:grid;gap:1.5rem;grid-template-columns:1fr auto}#overview_page>div:first-of-type{grid-column:2/3;text-align:right}#overview_page>div:nth-of-type(2){grid-row:1/2}}@media(any-hover: hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color), 0.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color), 0.5)}.list__item:hover{background:rgba(var(--text-color), 0.1);cursor:pointer}} \ No newline at end of file +*{padding:0;margin:0;box-sizing:border-box;font-family:"Roboto",sans-serif}:root{font-size:clamp(1rem,1.2vmax,1.2rem)}html,body{height:100%}body{--accent-color: #0d7377;--secondary-color: #ffac2e;--text-color: 20, 20, 20;--foreground-color: 252, 253, 255;--background-color: 241, 243, 248;--danger-color: rgb(255, 75, 75);--green: #1cad59;--yellow: rgb(220, 165, 0);color:rgba(var(--text-color), 1);background-color:rgba(var(--background-color), 1);overflow-y:hidden}body[data-theme=dark]{--accent-color: #32e0c4;--secondary-color: #d60739;--text-color: 220, 220, 220;--foreground-color: 27, 28, 29;--background-color: 21, 22, 22;--danger-color: rgb(255, 106, 106);--green: #00e676;--yellow: rgb(255, 213, 5)}p,strong{font-size:.9rem;max-width:65ch;line-height:1.7;color:rgba(var(--text-color), 0.9)}img{-o-object-fit:cover;object-fit:cover}a{color:inherit;text-decoration:none}a:focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}button{display:inline-flex;border:none;background-color:inherit}a:-webkit-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:-moz-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}sm-button{--border-radius: 0.3rem}ul{list-style:none}.table{display:grid;gap:.5rem;margin:1rem 0;position:relative;text-align:left;overflow-x:auto;border-radius:.3rem;border-collapse:separate;border-spacing:1rem 1.5rem;background-color:rgba(var(--text-color), 0.04)}.table p:only-of-type{margin-bottom:0}.tr{display:grid;gap:1rem;padding:1rem;grid-template-columns:11rem 1fr;width:100%}.tr:nth-of-type(odd){background-color:rgba(var(--text-color), 0.04)}.tr p{min-width:30ch}.flex{display:flex}.grid{display:grid}.hide{opacity:0;pointer-events:none}.hide-completely{display:none !important}.no-transformations{transform:none !important}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.breakable{overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-word;-webkit-hyphens:auto;hyphens:auto}.full-bleed{grid-column:1/4}.h1{font-size:2.5rem}.h2{font-size:2rem}.h3{font-size:1.4rem}.h4{font-size:1rem}.h5{font-size:.8rem}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.flex{display:flex}.grid{display:grid}.grid-3{grid-template-columns:1fr auto auto}.flow-column{grid-auto-flow:column}.gap-0-5{gap:.5rem}.gap-1{gap:1rem}.gap-1-5{gap:1.5rem}.gap-2{gap:2rem}.gap-3{gap:3rem}.text-align-right{text-align:right}.align-start{align-items:flex-start}.align-center{align-items:center}.text-center{text-align:center}.justify-start{justify-content:start}.justify-center{justify-content:center}.justify-right{margin-left:auto}.align-self-center{align-self:center}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.direction-column{flex-direction:column}.space-between{justify-content:space-between}.w-100{width:100%}.color-0-8{color:rgba(var(--text-color), 0.8)}.weight-400{font-weight:400}.weight-500{font-weight:500}.ripple{height:8rem;width:8rem;position:absolute;border-radius:50%;transform:scale(0);background:radial-gradient(circle, rgba(var(--text-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%);pointer-events:none}.interact{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.observe-empty-state:empty{display:none}.observe-empty-state:not(:empty)~.empty-state{display:none}.icon{width:1.5rem;height:1.5rem;fill:rgba(var(--text-color), 0.9)}.button__icon{height:1.2rem;width:1.2rem}.button__icon--left{margin-right:.5rem}.button__icon--right{margin-left:.5rem}h1,h2,h3,h4.h5{font-family:"Poppins",sans-serif}h2{margin:3rem 0 1rem 0;text-transform:capitalize}main{display:grid;height:100%}#main_header{padding:.5rem 1.5rem;border-bottom:1px solid rgba(var(--text-color), 0.1)}#side_nav_button{padding:.5rem;margin-left:-0.5rem}.right{max-height:100%;overflow-y:auto}#side_nav>:last-child{padding-bottom:3rem}#side_nav h4{font-size:.9rem;letter-spacing:.08em;text-transform:uppercase;padding:1.5rem}.right{padding:1.5rem}.right h1{margin-bottom:1.5rem}.list{list-style:none;display:flex;flex-direction:column;margin-bottom:.8rem}.list__item{display:flex;padding:.8rem 1.5rem;text-transform:capitalize}.list__item--active{color:var(--accent-color);background:rgba(var(--text-color), 0.06)}.card{display:flex;flex-direction:column;margin-right:1rem;border-radius:.4rem;padding:1.5rem;min-width:min(24rem,80%);background-color:rgba(var(--text-color), 0.06)}sm-carousel{margin-bottom:1rem}sm-tab-header{margin-bottom:1.5rem}.page{display:flex;flex-direction:column;padding-bottom:3rem}ol{padding:.6rem 1rem;max-width:75ch;margin-bottom:1.5rem}ol li{margin-bottom:1rem}ol li:last-of-type{margin-bottom:0}strong{max-width:65ch}strong.important{display:flex;padding:.5rem;margin:.5rem 0;border-radius:.3rem;color:rgba(0,0,0,.8);background-color:khaki}.highlight{display:inline-flex;font-family:"Roboto Mono",monospace;background-color:rgba(var(--text-color), 0.1);border-radius:.2rem;padding:.1rem .5rem;font-size:.9rem;line-height:1.6}#total_components_count{font-size:4rem}#components_selection_list{display:grid;gap:1.5rem;grid-template-columns:repeat(auto-fill, minmax(10rem, 1fr));padding:1.5rem 0 3rem 0}.comp-checkbox__title{margin-left:.5rem}.auto-grid-2{justify-content:center;justify-items:center;text-align:center;grid-template-columns:repeat(auto-fill, minmax(18rem, 1fr))}.screenshot{-o-object-fit:cover;object-fit:cover;-o-object-position:top;object-position:top;height:30rem;width:16rem;border-radius:1rem;justify-self:center;box-shadow:0 .5rem 1.5rem -0.5rem rgba(0,0,0,.3),0 0 0 .3rem #000}@media screen and (max-width: 640px){main{grid-template-rows:auto 1fr;grid-template-columns:1fr}}@media screen and (min-width: 640px){sm-popup{--width: 32rem}#main_header{padding:1rem 1.5rem;grid-area:main-header}#side_nav_button{display:none}main{grid-template-columns:14rem minmax(0, 1fr);grid-template-areas:"main-header main-header" ". ."}.right{display:grid;grid-template-columns:1fr 90% 1fr}.right>*{grid-column:2/3}.page__title{font-size:2.5rem}#overview_page{display:grid;gap:1.5rem;grid-template-columns:1fr auto}#overview_page>div:first-of-type{grid-column:2/3;text-align:right}#overview_page>div:nth-of-type(2){grid-row:1/2}}@media(any-hover: hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color), 0.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color), 0.5)}.list__item:hover{background:rgba(var(--text-color), 0.1);cursor:pointer}} \ No newline at end of file diff --git a/components/css/main.scss b/components/css/main.scss index 8b45057..c9e15df 100644 --- a/components/css/main.scss +++ b/components/css/main.scss @@ -46,6 +46,7 @@ strong { line-height: 1.7; color: rgba(var(--text-color), 0.9); } + img { object-fit: cover; } @@ -53,6 +54,7 @@ img { a { color: inherit; text-decoration: none; + &:focus-visible { box-shadow: 0 0 0 0.1rem rgba(var(--text-color), 1) inset; } @@ -67,12 +69,15 @@ button { a:any-link:focus-visible { outline: rgba(var(--text-color), 1) 0.1rem solid; } + sm-button { --border-radius: 0.3rem; } + ul { list-style: none; } + .table { display: grid; gap: 0.5rem; @@ -84,45 +89,56 @@ ul { border-collapse: separate; border-spacing: 1rem 1.5rem; background-color: rgba(var(--text-color), 0.04); + p:only-of-type { margin-bottom: 0; } } + .tr { display: grid; gap: 1rem; padding: 1rem; grid-template-columns: 11rem 1fr; width: 100%; + &:nth-of-type(odd) { background-color: rgba(var(--text-color), 0.04); } + p { min-width: 30ch; } } + .flex { display: flex; } + .grid { display: grid; } + .hide { opacity: 0; pointer-events: none; } + .hide-completely { display: none !important; } + .no-transformations { transform: none !important; } + .overflow-ellipsis { width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } + .breakable { overflow-wrap: break-word; word-wrap: break-word; @@ -133,21 +149,27 @@ ul { -webkit-hyphens: auto; hyphens: auto; } + .full-bleed { grid-column: 1/4; } + .h1 { font-size: 2.5rem; } + .h2 { font-size: 2rem; } + .h3 { font-size: 1.4rem; } + .h4 { font-size: 1rem; } + .h5 { font-size: 0.8rem; } @@ -155,262 +177,198 @@ ul { .uppercase { text-transform: uppercase; } + .capitalize { text-transform: capitalize; } + .flex { display: flex; } + .grid { display: grid; } + .grid-3 { grid-template-columns: 1fr auto auto; } + .flow-column { grid-auto-flow: column; } + .gap-0-5 { gap: 0.5rem; } + .gap-1 { gap: 1rem; } + .gap-1-5 { gap: 1.5rem; } + .gap-2 { gap: 2rem; } + .gap-3 { gap: 3rem; } + .text-align-right { text-align: right; } + .align-start { align-items: flex-start; } + .align-center { align-items: center; } + .text-center { text-align: center; } + .justify-start { justify-content: start; } + .justify-center { justify-content: center; } + .justify-right { margin-left: auto; } + .align-self-center { align-self: center; } + .justify-self-center { justify-self: center; } + .justify-self-start { justify-self: start; } + .justify-self-end { justify-self: end; } + .direction-column { flex-direction: column; } + .space-between { justify-content: space-between; } + .w-100 { width: 100%; } + .color-0-8 { color: rgba(var(--text-color), 0.8); } + .weight-400 { font-weight: 400; } + .weight-500 { font-weight: 500; } + .ripple { height: 8rem; width: 8rem; position: absolute; border-radius: 50%; transform: scale(0); - background: radial-gradient( - circle, - rgba(var(--text-color), 0.3) 0%, - rgba(0, 0, 0, 0) 50% - ); + background: radial-gradient(circle, + rgba(var(--text-color), 0.3) 0%, + rgba(0, 0, 0, 0) 50%); pointer-events: none; } + .interact { position: relative; overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; } + .observe-empty-state:empty { display: none; } -.observe-empty-state:not(:empty) ~ .empty-state { + +.observe-empty-state:not(:empty)~.empty-state { display: none; } + .icon { width: 1.5rem; height: 1.5rem; fill: rgba(var(--text-color), 0.9); } + .button__icon { height: 1.2rem; width: 1.2rem; + &--left { margin-right: 0.5rem; } + &--right { margin-left: 0.5rem; } } -//Syntax highlighting -.token.comment, -.token.block-comment, -.token.prolog, -.token.doctype, -.token.cdata { - color: #50cb93; -} - -.token.punctuation, -.token.tag { - color: #29b6f6; -} -.token.attr-name, -.token.namespace, -.token.deleted { - color: #1de9b6; -} - -.token.function-name { - color: #6196cc; -} - -.token.boolean, -.token.number, -.token.function { - color: #f08d49; -} - -.token.property, -.token.class-name, -.token.constant, -.token.symbol { - color: #f8c555; -} - -.token.selector, -.token.important, -.token.atrule, -.token.keyword, -.token.builtin { - color: #ff6767; -} - -.token.string, -.token.char, -.token.attr-value, -.token.regex, -.token.variable { - color: #84ffff; -} - -.token.operator, -.token.entity, -.token.url { - color: #67cdcc; -} - -.token.important, -.token.bold { - font-weight: bold; -} -.token.italic { - font-style: italic; -} - -.token.entity { - cursor: help; -} - -.token.inserted { - color: green; -} -pre { - max-width: 100%; - margin: 1rem 0; - padding: 0 1.5rem; - overflow-x: auto; - font-size: 0.9rem; - font-weight: 500; - white-space: pre; - border-radius: 0.5rem; - background: rgba(0, 0, 0, 0.9); - line-height: 1.7; -} -code { - border-radius: 0.3rem; - font-weight: 400; - padding: 0.2rem 0.4rem; - background: rgba(var(--text-color), 0.1); - color: rgba(255, 255, 255, 0.9); -} -code * { - color: rgba(255, 255, 255, 0.9); - font-family: "Roboto Mono", monospace; -} -pre code { - line-height: 1.4; - border-radius: none; - background: none; - width: 100%; -} - -// h1, h2, h3, h4.h5 { font-family: "Poppins", sans-serif; } + h2 { margin: 3rem 0 1rem 0; text-transform: capitalize; } + main { display: grid; height: 100%; } + #main_header { padding: 0.5rem 1.5rem; border-bottom: 1px solid rgba(var(--text-color), 0.1); } + #side_nav_button { padding: 0.5rem; margin-left: -0.5rem; } + .right { max-height: 100%; overflow-y: auto; } + #side_nav { - & > :last-child { + &> :last-child { padding-bottom: 3rem; } + h4 { font-size: 0.9rem; letter-spacing: 0.08em; @@ -418,27 +376,33 @@ main { padding: 1.5rem; } } + .right { padding: 1.5rem; + h1 { margin-bottom: 1.5rem; } } + .list { list-style: none; display: flex; flex-direction: column; margin-bottom: 0.8rem; } + .list__item { display: flex; padding: 0.8rem 1.5rem; text-transform: capitalize; + &--active { color: var(--accent-color); background: rgba(var(--text-color), 0.06); } } + .card { display: flex; flex-direction: column; @@ -448,31 +412,39 @@ main { min-width: min(24rem, 80%); background-color: rgba(var(--text-color), 0.06); } + sm-carousel { margin-bottom: 1rem; } + sm-tab-header { margin-bottom: 1.5rem; } + .page { display: flex; flex-direction: column; padding-bottom: 3rem; } + ol { padding: 0.6rem 1rem; max-width: 75ch; margin-bottom: 1.5rem; + li { margin-bottom: 1rem; + &:last-of-type { margin-bottom: 0; } } } + strong { max-width: 65ch; } + strong.important { display: flex; padding: 0.5rem; @@ -481,6 +453,7 @@ strong.important { color: rgba(0, 0, 0, 0.8); background-color: khaki; } + .highlight { display: inline-flex; font-family: "Roboto Mono", monospace; @@ -490,24 +463,29 @@ strong.important { font-size: 0.9rem; line-height: 1.6; } + #total_components_count { font-size: 4rem; } + #components_selection_list { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); padding: 1.5rem 0 3rem 0; } + .comp-checkbox__title { margin-left: 0.5rem; } + .auto-grid-2 { justify-content: center; justify-items: center; text-align: center; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); } + .screenshot { object-fit: cover; object-position: top; @@ -517,50 +495,62 @@ strong.important { justify-self: center; box-shadow: 0 0.5rem 1.5rem -0.5rem rgba(0, 0, 0, 0.3), 0 0 0 0.3rem black; } + @media screen and (max-width: 640px) { main { grid-template-rows: auto 1fr; grid-template-columns: 1fr; } } + @media screen and (min-width: 640px) { sm-popup { --width: 32rem; } + #main_header { padding: 1rem 1.5rem; grid-area: main-header; } + #side_nav_button { display: none; } + main { grid-template-columns: 14rem minmax(0, 1fr); grid-template-areas: "main-header main-header" ". ."; } + .right { display: grid; grid-template-columns: 1fr 90% 1fr; - & > * { + + &>* { grid-column: 2/3; } } + .page__title { font-size: 2.5rem; } + #overview_page { display: grid; gap: 1.5rem; grid-template-columns: 1fr auto; - & > div:first-of-type { + + &>div:first-of-type { grid-column: 2/3; text-align: right; } - & > div:nth-of-type(2) { + + &>div:nth-of-type(2) { grid-row: 1/2; } } } + @media (any-hover: hover) { ::-webkit-scrollbar { width: 0.5rem; @@ -570,12 +560,14 @@ strong.important { ::-webkit-scrollbar-thumb { background: rgba(var(--text-color), 0.3); border-radius: 1rem; + &:hover { background: rgba(var(--text-color), 0.5); } } + .list__item:hover { background: rgba(var(--text-color), 0.1); cursor: pointer; } -} +} \ No newline at end of file diff --git a/components/dist/syntax-highlighter.js b/components/dist/syntax-highlighter.js index d755a73..5099d78 100644 --- a/components/dist/syntax-highlighter.js +++ b/components/dist/syntax-highlighter.js @@ -115,24 +115,38 @@ template.innerHTML = /*html*/` class SyntaxHighlighter extends HTMLElement { static loaded = false; - render = (language = 'javascript') => { + escapeHtml = (str) => { + return str.replace(/&/g, '&') + .replace(/ { if (!Prism.languages.hasOwnProperty(language)) return console.error(`Language ${language} not supported`); const code = this.innerHTML; - const highlightedCode = Prism.highlight(code, Prism.languages[language], language); + // remove equal indentation from lines + const lines = code.split('\n'); + const indent = lines.reduce((acc, line) => { + if (/^\s*$/.test(line)) return acc; // ignore empty lines + const lineIndent = line.match(/^\s*/)[0].length; + return Math.min(acc, lineIndent); + }, Infinity); + const regex = new RegExp(`^\\s{${indent}}`); + const formattedCode = lines.map(line => line.replace(regex, '')).join('\n'); this.innerHTML = ` -
${highlightedCode}
- `;
+ ${formattedCode}
+ `;
}
connectedCallback() {
- console.log('connected', SyntaxHighlighter.loaded);
if (!SyntaxHighlighter.loaded) {
document.head.appendChild(template.content.cloneNode(true));
SyntaxHighlighter.loaded = true;
}
- setTimeout(() => {
- this.render(this.getAttribute('language') || 'javascript');
- }, 0);
+ if (this.querySelector('template')) {
+ this.innerHTML = this.querySelector('template').innerHTML;
+ }
+ this.innerHTML = this.escapeHtml(this.innerHTML);
+ this.render(this.getAttribute('language') || 'html');
}
disconnectedCallback() {
diff --git a/components/dist/syntax-highlighter.min.js b/components/dist/syntax-highlighter.min.js
index f6752f0..ee1d974 100644
--- a/components/dist/syntax-highlighter.min.js
+++ b/components/dist/syntax-highlighter.min.js
@@ -1 +1 @@
-var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(u){var c=/\blang(?:uage)?-([\w-]+)\b/i,n=0,e={},M={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof W?new W(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/=l.reach);y+=m.value.length,m=m.next){var b=m.value;if(t.length>n.length)return;if(!(b instanceof W)){var k,x=1;if(h){if(!(k=z(v,y,n,f)))break;var w=k.index,A=k.index+k[0].length,P=y;for(P+=m.value.length;P<=w;)P+=(m=m.next).value.length;if(y=P-=m.value.length,m.value instanceof W)continue;for(var E=m;E!==t.tail&&(Pl.reach&&(l.reach=N);var j=m.prev;if(O&&(j=I(t,j,O),y+=O.length),q(t,j,x),m=I(t,j,new W(o,g?M.tokenize(S,g):S,d,S)),L&&I(t,m,L),1${highlightedCode}\n `};connectedCallback(){console.log("connected",SyntaxHighlighter.loaded),SyntaxHighlighter.loaded||(document.head.appendChild(template.content.cloneNode(!0)),SyntaxHighlighter.loaded=!0),setTimeout((()=>{this.render(this.getAttribute("language")||"javascript")}),0)}disconnectedCallback(){}}window.customElements.define("syntax-highlighter",SyntaxHighlighter);
\ No newline at end of file
+var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(u){var c=/\blang(?:uage)?-([\w-]+)\b/i,n=0,e={},M={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof W?new W(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/=l.reach);y+=m.value.length,m=m.next){var b=m.value;if(t.length>n.length)return;if(!(b instanceof W)){var k,x=1;if(h){if(!(k=z(v,y,n,f)))break;var w=k.index,A=k.index+k[0].length,P=y;for(P+=m.value.length;P<=w;)P+=(m=m.next).value.length;if(y=P-=m.value.length,m.value instanceof W)continue;for(var E=m;E!==t.tail&&(Pl.reach&&(l.reach=N);var j=m.prev;if(O&&(j=I(t,j,O),y+=O.length),q(t,j,x),m=I(t,j,new W(o,g?M.tokenize(S,g):S,d,S)),L&&I(t,m,L),1${formattedCode}\n `};connectedCallback(){SyntaxHighlighter.loaded||(document.head.appendChild(template.content.cloneNode(!0)),SyntaxHighlighter.loaded=!0),this.querySelector("template")&&(this.innerHTML=this.querySelector("template").innerHTML),this.innerHTML=this.escapeHtml(this.innerHTML),this.render(this.getAttribute("language")||"html")}disconnectedCallback(){}}window.customElements.define("syntax-highlighter",SyntaxHighlighter);
\ No newline at end of file
diff --git a/components/index.html b/components/index.html
index 517f14a..2d87d6f 100644
--- a/components/index.html
+++ b/components/index.html
@@ -16,10 +16,6 @@