UNPKG

yacho-css-design

Version:

CSS spreadsheet for WCAG 2.1 compatible projects with various amount of components.

919 lines (788 loc) 15.6 kB
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap'); *:not(code) { font-family: "Open Sans", "Inter", Verdana, sans-serif; text-rendering: optimizeLegibility; } * { box-sizing: border-box; } /* Styl body */ body { line-height: 1.5; font-size: 1rem; display: flex; flex-direction: column; width: 100vw; min-height: 100vh; overflow-x: hidden; position: relative; padding: 0; margin: 0; } /* Styl main */ main { width: 100vw; display: flex; flex-direction: column; justify-content: start; align-items: center; margin-top: 6rem; position: relative; flex: 1; flex-grow: 1; } main .wrapper { width: 55vw; display: flex; flex-direction: column; position: relative; gap: 1rem; } main .wrapper:has(aside) { flex-direction: row; } main .wrapper:has(aside) .rows { display: flex; flex-direction: column; position: relative; gap: 1rem; } main .wrapper .row { width: 100%; display: block; } main .wrapper .row:has(.column) { display: flex; flex-direction: column; flex-direction: row; gap: 1rem; } main .wrapper .row .column { width: 100%; max-width: 100%; display: block; overflow-x: auto; } /* Styl nav */ nav { width: 100vw; background-color: #fff; border-bottom: 2px solid rgba(0,0,0,0.1); padding: 0; margin: 0; display: flex; position: fixed; top: 0; z-index: 999; max-height: 4rem; height: 4rem; gap: 0.5rem; } nav .website-logo { display: flex; padding-left: 0.5rem; width: -moz-min-content; width: min-content; } nav .website-logo::after { content: ""; display: block; height: 85%; transform: translateY(10%); width: 0.2rem; margin-left: 0.5rem; background-color: rgba(0, 0, 0, 0.15); } nav .website-logo img { padding: none; margin: none; display: block; height: calc(4rem - 2px); width: auto; } nav ul { width: 100%; display: flex; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; } nav ul li img { padding: none; margin: none; display: block; height: calc(4rem - 2px); width: auto; } nav ul li a:has(img),nav ul li .nav-item:has(img) { display: flex; width: -moz-min-content; width: min-content; padding: 0 !important; } nav ul li a.square-img:has(img),nav ul li .nav-item.square-img:has(img) { width: 5rem !important; } nav ul li a.square-img img,nav ul li .nav-item.square-img img { width: 4rem !important; height: auto; } nav ul li a, nav ul li .nav-item { padding: 1rem; height: 100%; justify-content: center; align-items: center; display: flex; color: rgba(0,0,0,0.75); text-decoration: none !important; cursor: pointer; text-align: center; } nav ul li a:hover, nav ul li .nav-item:hover { color: rgb(0,0,0); background-color: rgba(0,0,0,0.03); } nav button.menu-collapse { width: 4rem !important; height: calc(4rem - 2px); background-color: rgba(0, 0, 0, 0.1); border: none; cursor: pointer; font-size: 2rem; color:rgba(0, 0, 0, 0.3); position: absolute; top: 0; right: 0; display: none; } /* Styl link */ a { color: #0052a5; text-decoration: none; } a:hover { text-decoration: underline; } /* Styl header */ h1,h2,h3,h4,h5,h6 { padding: 0; margin: 0.25rem 0; } /* Styl p */ p { margin: 0.5rem 0; } /* Styl hr */ hr { width: 100%; border: 1px solid rgba(0,0,0,0.2); border-bottom: transparent; padding: 0; margin: 0.5rem 0; } /* Styl button */ .button { padding: 0.5rem 0.75rem; color: #0052a5; font-size: 1rem !important; border: 2px solid transparent; border-radius: 0.25rem; width: auto !important; display: inline-block; align-items: center; justify-content: center; cursor: pointer; gap: 0.5rem; text-align: center; background-color: transparent; } .button.full-width { width: 100% !important; } .button:is(a) div { display: flex; gap: 0.5rem; } .button:is(a) div { align-items: center; } .button:is(a) { display: inline-block !important; } .button:has(i) { display: flex; text-align: left; } .button:hover { text-decoration: underline !important; opacity: 0.9; } .button.primary { background-color: #0052a5; color: #ffffff; } .button.secondary { border-color: #0052a5 !important; background-color: transparent; color: #0052a5; } /* Styl table */ .table { width: 100%; max-width: 100%; overflow-x: auto; border-radius: 0.5rem; border: 1px solid rgba(0,0,0,0.1); } .table.table-no-border { border: 1px solid transparent; } .table table { min-width: 100%; padding: 0; border-collapse: collapse; } .table table th { white-space: nowrap; } .table table th,.table table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid rgba(0,0,0,0.1); } .table table tr:has(th + td) th { text-align: right; white-space: normal; } .table table tr:has(th + td) td { white-space: normal; } .table table tr:last-child th,.table table tr:last-child td { border-bottom: none; } /* Styl details */ details { border: 1px solid rgba(0,0,0,0.1); border-radius: 0.25rem; padding: 0.5em 0.5em 0; margin-bottom: 1rem; } details summary { font-size: 1.1rem; font-weight: bold; margin: -0.5rem -0.5rem 0; padding: 0.5rem; color: #0052a5; cursor: pointer; } details summary:hover { text-decoration: underline; } details[open] { padding: 0.5rem; padding-bottom: 0; overflow-y: auto; max-height: 600px; } details[open] summary { border-bottom: 1px solid rgba(0,0,0,0.1); margin-bottom: 0.5em; } details[open]:has(div.code-block) div.code-block { width: calc(100% + 1rem); margin-left: -0.5rem; margin-top: -0.5rem; } details p { padding: 0 0.5rem; } /* Styl code */ code { padding: 0.1rem 0.25rem; display: flex; flex-direction: column; background-color: rgba(0,0,0,0.05); width: -moz-max-content; width: max-content; } code.code-preview { width: 100%; border: 1px solid rgba(0,0,0,0.1); padding: 0.5rem; border-radius: 0.5rem; } pre { margin: 0; padding: 0; } /* Styl cite */ cite::before { content: "\201E"; } cite::after { content: "\201D"; } /* Styl blockquote */ blockquote { font-style: italic; } blockquote::before { content: "\201E"; } blockquote::after { content: "\201D"; } /* Styl footer */ footer { width: 100vw; display: flex; flex-direction: column; align-items: center; margin: 1rem 0; } footer .wrapper { width: 55vw; } footer .wrapper ul { width: 100%; display: flex; margin: 0; padding: 0; list-style: none; gap: 0.5rem; flex-wrap: wrap; } footer .wrapper ul a { color: rgba(0, 0, 0, 0.8); } /* Styl dialog box */ .dialog-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; z-index: 1000; } .dialog-box { background: white; border-radius: 0.35rem; max-width: 35vw; max-height: 60vh; overflow-y: auto; overflow-x: hidden; width: 100%; padding: 1rem; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); } .dialog-header { border-bottom: 1px solid rgba(0, 0, 0, 0.1); padding: 0.5rem 0; padding-top: 0; margin: 0; } .dialog-header h3 { padding: 0; margin: 0; } .dialog-content { margin: 0.5rem 0 !important; display: flex; flex-direction: column; } .dialog-footer { display: flex; flex-direction: row; flex-wrap: wrap; gap: 0.5rem; width: 100%; padding: 0; margin: 0; } /* Styl form control */ form { width: 100%; display: block; gap: 0.5rem; } div.form-group { width: 100%; display: flex; flex-direction: column; } div.form-group:has(input[type=checkbox]),div.form-group:has(input[type=radio]) { flex-direction: row; gap: 0.5rem; } div.form-group label { margin: 0.25rem 0; } div.form-group .form-control { width: 100%; font-size: 1rem; padding: 0.4rem 0.7rem; border-radius: 0.25rem; border: 2px solid rgba(0, 0, 0, 0.15); } div.form-group textarea.form-control { min-height: 3rem; resize: vertical; } div.form-group .form-control:focus { outline: 3px solid #0052a5; outline-offset: -2px; } div.form-group label span.required { color: red; } form div.button-footer { width: 100%; display: flex; margin-top: 1rem; gap: 1rem; } /* Styl kbd */ kbd { background-color: rgba(0, 0, 0, 0.03); padding: 0.25rem 0.5rem; border-radius: 0.25rem; font-size: 1rem; border: 1px solid rgba(0, 0, 0, 0.1); border-bottom-width: 3px; width: -moz-min-content; width: min-content; } /* Styl progress */ progress { border-radius: 0.25rem; border: 1px solid rgba(0, 0, 0, 0.2); width: 100%; height: 1.25rem; } progress::-webkit-progress-bar { background-color: #fff; border-radius: 7px; } progress::-webkit-progress-value { background-color: #0052a5; border-radius: 0.25rem 0 0 0.25rem; } /* Styl button group */ .button-group { width: 100%; display: flex; justify-content: center; } .button-group .button { width: 100% !important; border-radius: 0; } .button-group .button:first-child { border-radius: 0.25rem 0 0 0.25rem; } .button-group .button:last-child { border-radius: 0 0.25rem 0.25rem 0; } .button-group .button.secondary { border: none; border-right: 2px solid #0052a5; border-top: 2px solid #0052a5; border-bottom: 2px solid #0052a5; } .button-group .button.secondary:first-child { border-left: 2px solid #0052a5; } .button-group .button:only-child { border-radius: 0.25rem; } /* Styl fieldset */ fieldset { border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 0.5rem; padding: 1rem; overflow: hidden !important; } /* Styl dodatkowego navbaru po lewej */ aside { width: 70vw; height: 100%; position: sticky; left: 0; top: 70px; display: flex; flex-direction: column; border-right: 2px solid rgba(0, 0, 0, 0.1); } aside ul { width: 100%; display: flex; flex-direction: column; gap: 0.25rem; padding: 0; margin: 0; list-style: none; } aside ul li a { padding: 0.5rem; display: flex; } aside ul li a:hover { background-color: rgba(0, 0, 0, 0.03); } /* Styl dropdown */ .dropdown { position: relative; z-index: 999; } .dropdown::after { content: "\25bc"; font-size: 0.8rem; margin-left: 0.2rem; } .dropdown ul { position: absolute; min-width: 100%; background-color: #fff; border: 2px solid rgba(0, 0, 0, 0.1); border-radius: 0 0 0.5rem 0.5rem; top: 100%; display: none; } .dropdown ul.oversize-1 { width: calc(100% + 2rem); } .dropdown ul.oversize-2 { width: calc(100% + 4rem); } .dropdown ul.oversize-3 { width: calc(100% + 6rem); } .dropdown ul.oversize-4 { width: calc(100% + 8rem); } .dropdown ul.oversize-5 { width: calc(100% + 10rem); } .dropdown:hover ul,.dropdown:focus ul { display: flex; } .dropdown ul li a { padding: 0.5rem 0.75rem; } .dropdown ul li { width: 100%; } /* Styl spinner */ .spinner { width: -moz-fit-content; width: fit-content; } .spinner span.spinner { -webkit-animation-name: spin; -webkit-animation-duration: 1000ms; -webkit-animation-iteration-count: infinite; -webkit-animation-timing-function: linear; -moz-animation-name: spin; -moz-animation-duration: 1000ms; -moz-animation-iteration-count: infinite; -moz-animation-timing-function: linear; -ms-animation-name: spin; -ms-animation-duration: 1000ms; -ms-animation-iteration-count: infinite; -ms-animation-timing-function: linear; animation-name: spin; animation-duration: 1000ms; animation-iteration-count: infinite; animation-timing-function: linear; width: 3rem; height: 3rem; border-radius: 3rem; border: 0.4rem solid rgba(0, 0, 0, 0.5); display: block; position: relative; } .spinner span.spinner::after { content: ""; position: absolute; width: 2rem; height: 1rem; background-color: #fff; top: -0.5rem; border-radius: 1rem; left: calc(50% - 1rem); } @keyframes spin { from {transform:rotate(0deg);} to {transform:rotate(360deg);} } /* Styl blokowych linków */ ul.block-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; list-style: none; padding: 0; margin: 0; } ul.block-links li a { border: 1px solid rgba(0,0,0,0.1); padding: 0.5rem; margin: 0; border-radius: 0.5rem; } ul.block-links li a { display: block; width: 100%; height: 100%; text-decoration: none !important; } ul.block-links li h3 { display: flex; gap: 0.5rem; font-weight: 500; align-items: center; padding: 0; margin: 0; } ul.block-links li a:hover h3 { text-decoration: underline; } ul.block-links li h3 i.block-icon { font-size: 1.75rem; padding: 0; margin: 0; } ul.block-links li a :not(h3,i,span) { color: #000; text-decoration: none !important; } ul.block-links li a:hover p { text-decoration: none !important; } ul.block-links li a p { padding-bottom: 0; margin-bottom: 0; text-decoration: none !important; } /* Breakpointy responsywnego layoutu */ @media screen and (max-width: 480px) { } @media screen and (max-width: 768px) { ul.block-links { display: grid; grid-template-columns: repeat(1, 1fr); } main .wrapper .row:has(.column) { flex-direction: column; } main .wrapper, footer .wrapper { width: 90vw !important; } main:has(.wrapper aside) .wrapper { flex-direction: column; gap: 2rem; } main .wrapper aside { position: relative; width: 100%; border: none; top: 0; } main .wrapper aside ul::before { width: 100%; font-weight: bold; } main .wrapper aside ul li a { width: -moz-max-content; width: max-content; } main .wrapper aside ul li a::after { content: ","; margin-left: 0.25rem; color: #000; } main .wrapper aside ul li:last-child a::after { content: ""; } } @media screen and (max-width: 1024px) { main .wrapper, footer .wrapper { width: 80vw; } .dialog-box { width: 95vw !important; max-width: 95vw; } nav button.menu-collapse { display: flex; justify-content: center; align-items: center; } nav ul { position: absolute; height: calc(100vh - 4rem); top: 4rem; left: -70vw; align-items: start; background-color: #fff; width: 70vw; display: block; transition: left 200ms ease-in-out; border-right: 2px solid rgba(0, 0, 0, 0.1); overflow-y: auto; padding-bottom: 10rem; } nav ul li a, nav ul li { width: 100%; display: block; } .dropdown { display: flex; flex-direction: column; } .dropdown::after { content: ""; } .dropdown:hover,.dropdown:focus { background-color: transparent !important; } .dropdown ul { position: static; width: 100% !important; height: auto; display: block; padding: 0; } .button-group { flex-direction: column; } .button-group .button.secondary { border-bottom: 2px solid #0052a5; border-left: 2px solid #0052a5; border-right: 2px solid #0052a5; border-top: 0; } .button-group .button.secondary:first-child { border-top: 2px solid #0052a5; border-left: 2px solid #0052a5; border-right: 2px solid #0052a5; border-radius: 0.25rem 0.25rem 0 0; } .button-group .button:first-child { border-radius: 0.25rem 0.25rem 0 0; } .button-group .button:last-child { border-radius: 0 0 0.25rem 0.25rem; } nav ul li img { padding: none; margin: none; display: block; height: auto; width: 100%; } }