diff --git a/css/grid.css b/css/grid.css new file mode 100644 index 0000000..347ba14 --- /dev/null +++ b/css/grid.css @@ -0,0 +1,209 @@ +/* + Grid + ======================================== +*/ + +:root { + --grid-gutter: 24px; +} + +/* Container */ +.container { + width: 100%; + padding: 0 calc(var(--grid-gutter) / 2); + margin: 0 auto; +} + +@media (min-width: 576px) { .container { max-width: 540px; } } +@media (min-width: 768px) { .container { max-width: 720px; } } +@media (min-width: 992px) { .container { max-width: 960px; } } +@media (min-width: 1200px) { .container { max-width: 1140px; } } + +.container-fluid { + width: 100%; + padding: 0 calc(var(--grid-gutter) / 2); + margin: 0 auto; +} + +/* Row */ +.row { + display: flex; + flex-wrap: wrap; + margin: 0 calc(var(--grid-gutter) / -2); +} + +/* Base column styles */ +[class*="col"] { + padding: 0 calc(var(--grid-gutter) / 2); +} + +.col { + flex: 1 0 0%; +} + +.col-auto { + flex: 0 0 auto; + width: auto; +} + +/* Column widths */ +.col-1 { flex: 0 0 8.33333%; max-width: 8.33333%; } +.col-2 { flex: 0 0 16.66667%; max-width: 16.66667%; } +.col-3 { flex: 0 0 25%; max-width: 25%; } +.col-4 { flex: 0 0 33.33333%; max-width: 33.33333%; } +.col-5 { flex: 0 0 41.66667%; max-width: 41.66667%; } +.col-6 { flex: 0 0 50%; max-width: 50%; } +.col-7 { flex: 0 0 58.33333%; max-width: 58.33333%; } +.col-8 { flex: 0 0 66.66667%; max-width: 66.66667%; } +.col-9 { flex: 0 0 75%; max-width: 75%; } +.col-10 { flex: 0 0 83.33333%; max-width: 83.33333%; } +.col-11 { flex: 0 0 91.66667%; max-width: 91.66667%; } +.col-12 { flex: 0 0 100%; max-width: 100%; } + +/* Offset classes */ +.offset-1 { margin-left: 8.33333%; } +.offset-2 { margin-left: 16.66667%; } +.offset-3 { margin-left: 25%; } +.offset-4 { margin-left: 33.33333%; } +.offset-5 { margin-left: 41.66667%; } +.offset-6 { margin-left: 50%; } +.offset-7 { margin-left: 58.33333%; } +.offset-8 { margin-left: 66.66667%; } +.offset-9 { margin-left: 75%; } +.offset-10 { margin-left: 83.33333%; } +.offset-11 { margin-left: 91.66667%; } + +/* Small breakpoint (576px and up) */ +@media (min-width: 576px) { + .col-sm { flex: 1 0 0%; } + .col-sm-auto { flex: 0 0 auto; width: auto; } + .col-sm-1 { flex: 0 0 8.33333%; max-width: 8.33333%; } + .col-sm-2 { flex: 0 0 16.66667%; max-width: 16.66667%; } + .col-sm-3 { flex: 0 0 25%; max-width: 25%; } + .col-sm-4 { flex: 0 0 33.33333%; max-width: 33.33333%; } + .col-sm-5 { flex: 0 0 41.66667%; max-width: 41.66667%; } + .col-sm-6 { flex: 0 0 50%; max-width: 50%; } + .col-sm-7 { flex: 0 0 58.33333%; max-width: 58.33333%; } + .col-sm-8 { flex: 0 0 66.66667%; max-width: 66.66667%; } + .col-sm-9 { flex: 0 0 75%; max-width: 75%; } + .col-sm-10 { flex: 0 0 83.33333%; max-width: 83.33333%; } + .col-sm-11 { flex: 0 0 91.66667%; max-width: 91.66667%; } + .col-sm-12 { flex: 0 0 100%; max-width: 100%; } + + .offset-sm-0 { margin-left: 0; } + .offset-sm-1 { margin-left: 8.33333%; } + .offset-sm-2 { margin-left: 16.66667%; } + .offset-sm-3 { margin-left: 25%; } + .offset-sm-4 { margin-left: 33.33333%; } + .offset-sm-5 { margin-left: 41.66667%; } + .offset-sm-6 { margin-left: 50%; } + .offset-sm-7 { margin-left: 58.33333%; } + .offset-sm-8 { margin-left: 66.66667%; } + .offset-sm-9 { margin-left: 75%; } + .offset-sm-10 { margin-left: 83.33333%; } + .offset-sm-11 { margin-left: 91.66667%; } +} + +/* Medium breakpoint (768px and up) */ +@media (min-width: 768px) { + .col-md { flex: 1 0 0%; } + .col-md-auto { flex: 0 0 auto; width: auto; } + .col-md-1 { flex: 0 0 8.33333%; max-width: 8.33333%; } + .col-md-2 { flex: 0 0 16.66667%; max-width: 16.66667%; } + .col-md-3 { flex: 0 0 25%; max-width: 25%; } + .col-md-4 { flex: 0 0 33.33333%; max-width: 33.33333%; } + .col-md-5 { flex: 0 0 41.66667%; max-width: 41.66667%; } + .col-md-6 { flex: 0 0 50%; max-width: 50%; } + .col-md-7 { flex: 0 0 58.33333%; max-width: 58.33333%; } + .col-md-8 { flex: 0 0 66.66667%; max-width: 66.66667%; } + .col-md-9 { flex: 0 0 75%; max-width: 75%; } + .col-md-10 { flex: 0 0 83.33333%; max-width: 83.33333%; } + .col-md-11 { flex: 0 0 91.66667%; max-width: 91.66667%; } + .col-md-12 { flex: 0 0 100%; max-width: 100%; } + + .offset-md-0 { margin-left: 0; } + .offset-md-1 { margin-left: 8.33333%; } + .offset-md-2 { margin-left: 16.66667%; } + .offset-md-3 { margin-left: 25%; } + .offset-md-4 { margin-left: 33.33333%; } + .offset-md-5 { margin-left: 41.66667%; } + .offset-md-6 { margin-left: 50%; } + .offset-md-7 { margin-left: 58.33333%; } + .offset-md-8 { margin-left: 66.66667%; } + .offset-md-9 { margin-left: 75%; } + .offset-md-10 { margin-left: 83.33333%; } + .offset-md-11 { margin-left: 91.66667%; } +} + +/* Large breakpoint (992px and up) */ +@media (min-width: 992px) { + .col-lg { flex: 1 0 0%; } + .col-lg-auto { flex: 0 0 auto; width: auto; } + .col-lg-1 { flex: 0 0 8.33333%; max-width: 8.33333%; } + .col-lg-2 { flex: 0 0 16.66667%; max-width: 16.66667%; } + .col-lg-3 { flex: 0 0 25%; max-width: 25%; } + .col-lg-4 { flex: 0 0 33.33333%; max-width: 33.33333%; } + .col-lg-5 { flex: 0 0 41.66667%; max-width: 41.66667%; } + .col-lg-6 { flex: 0 0 50%; max-width: 50%; } + .col-lg-7 { flex: 0 0 58.33333%; max-width: 58.33333%; } + .col-lg-8 { flex: 0 0 66.66667%; max-width: 66.66667%; } + .col-lg-9 { flex: 0 0 75%; max-width: 75%; } + .col-lg-10 { flex: 0 0 83.33333%; max-width: 83.33333%; } + .col-lg-11 { flex: 0 0 91.66667%; max-width: 91.66667%; } + .col-lg-12 { flex: 0 0 100%; max-width: 100%; } + + .offset-lg-0 { margin-left: 0; } + .offset-lg-1 { margin-left: 8.33333%; } + .offset-lg-2 { margin-left: 16.66667%; } + .offset-lg-3 { margin-left: 25%; } + .offset-lg-4 { margin-left: 33.33333%; } + .offset-lg-5 { margin-left: 41.66667%; } + .offset-lg-6 { margin-left: 50%; } + .offset-lg-7 { margin-left: 58.33333%; } + .offset-lg-8 { margin-left: 66.66667%; } + .offset-lg-9 { margin-left: 75%; } + .offset-lg-10 { margin-left: 83.33333%; } + .offset-lg-11 { margin-left: 91.66667%; } +} + +/* Extra large breakpoint (1200px and up) */ +@media (min-width: 1200px) { + .col-xl { flex: 1 0 0%; } + .col-xl-auto { flex: 0 0 auto; width: auto; } + .col-xl-1 { flex: 0 0 8.33333%; max-width: 8.33333%; } + .col-xl-2 { flex: 0 0 16.66667%; max-width: 16.66667%; } + .col-xl-3 { flex: 0 0 25%; max-width: 25%; } + .col-xl-4 { flex: 0 0 33.33333%; max-width: 33.33333%; } + .col-xl-5 { flex: 0 0 41.66667%; max-width: 41.66667%; } + .col-xl-6 { flex: 0 0 50%; max-width: 50%; } + .col-xl-7 { flex: 0 0 58.33333%; max-width: 58.33333%; } + .col-xl-8 { flex: 0 0 66.66667%; max-width: 66.66667%; } + .col-xl-9 { flex: 0 0 75%; max-width: 75%; } + .col-xl-10 { flex: 0 0 83.33333%; max-width: 83.33333%; } + .col-xl-11 { flex: 0 0 91.66667%; max-width: 91.66667%; } + .col-xl-12 { flex: 0 0 100%; max-width: 100%; } + + .offset-xl-0 { margin-left: 0; } + .offset-xl-1 { margin-left: 8.33333%; } + .offset-xl-2 { margin-left: 16.66667%; } + .offset-xl-3 { margin-left: 25%; } + .offset-xl-4 { margin-left: 33.33333%; } + .offset-xl-5 { margin-left: 41.66667%; } + .offset-xl-6 { margin-left: 50%; } + .offset-xl-7 { margin-left: 58.33333%; } + .offset-xl-8 { margin-left: 66.66667%; } + .offset-xl-9 { margin-left: 75%; } + .offset-xl-10 { margin-left: 83.33333%; } + .offset-xl-11 { margin-left: 91.66667%; } +} + +/* Utility classes */ +.no-gutters { + margin-right: 0; + margin-left: 0; +} + +.no-gutters > [class*="col"] { + padding-right: 0; + padding-left: 0; +} diff --git a/css/navbar.css b/css/navbar.css new file mode 100644 index 0000000..c8fe45e --- /dev/null +++ b/css/navbar.css @@ -0,0 +1,63 @@ +/* Variables */ +:root { + --navbar-height: 40px; + --navbar-bg: #fafafa; + --navbar-bg-highlight: #f2f2f2; + --navbar-bg-active-top: #f2f2f2; + --navbar-bg-active-highlight: #e6e6e6; + --navbar-border: #d4d4d4; + --navbar-link: #777; + --navbar-link-hover: #333; + --navbar-link-active: #555; + --navbar-active: #08c; + --navbar-active-bg: transparent; + --navbar-brand-color: var(--navbar-link); +} + +/* Navbar Base */ +.navbar { + display: flex; + align-items: center; + justify-content: space-between; + min-height: var(--navbar-height); + margin-bottom: 1.25rem; + padding: 0 1.25rem; + background-color: var(--navbar-bg); + background-image: linear-gradient(to bottom, white, var(--navbar-bg-highlight)); + border: 1px solid var(--navbar-border); + border-radius: 4px; + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); +} + +.navbar .nav-group { + display: flex; + align-items: center; +} + +.navbar .nav-menu { + display: flex; + align-items: center; + + li { + display: inline-flex; + margin-right: 1rem; + } + + li.active { + background-image: linear-gradient(to bottom, var(--navbar-bg-active-top), var(--navbar-bg-active-highlight)); + color: var(--navbar-link-active); + } +} + +.navbar .brand { + display: block; + font-size: 20px; + font-weight: 200; + color: var(--navbar-brand-color); + margin-right: 1.25rem; + text-shadow: 0 1px 0 white; + + &:hover, &:focus { + text-decoration: none; + } +} diff --git a/css/reset.css b/css/reset.css new file mode 100644 index 0000000..bbea20d --- /dev/null +++ b/css/reset.css @@ -0,0 +1,121 @@ +/* + Reset + ======================================== +*/ + +/* Box sizing normalization */ +*, +*::before, +*::after { + box-sizing: border-box; +} + +/* Document basics */ +html { + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} + +/* Reset margins */ +body, +h1, h2, h3, h4, h5, h6, +p, blockquote, pre, +dl, dd, ol, ul, +form, fieldset, legend, +figure, figcaption { + margin: 0; + padding: 0; +} + +/* Body defaults */ +body { + line-height: 1.5; + font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", sans-serif; +} + +/* Lists */ +ul, ol { + list-style: none; +} + +/* Tables */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +/* Media elements */ +img, svg, video, canvas, audio, iframe, embed, object { + display: block; + max-width: 100%; + height: auto; +} + +/* Form elements */ +button, +input, +select, +textarea { + font: inherit; + color: inherit; + margin: 0; +} + +/* Button defaults */ +button { + background: transparent; + border: 0; + padding: 0; + cursor: pointer; +} + +/* Links */ +a { + color: inherit; + text-decoration: none; +} + +/* Pre/Code formatting */ +pre, code, kbd, samp { + font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; + font-size: 1em; +} + +/* Subscript/Superscript */ +sub, sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Horizontal rule */ +hr { + height: 0; + border: 0; + border-top: 1px solid #e5e5e5; +} + +/* Accessibility improvements */ +[tabindex="-1"]:focus { + outline: none !important; +} + +/* Remove animations for users who prefer reduced motion */ +@media (prefers-reduced-motion: reduce) { + *, *::before, *::after { + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.01ms !important; + scroll-behavior: auto !important; + } +} diff --git a/docs/grid.md b/docs/grid.md new file mode 100644 index 0000000..73ca252 --- /dev/null +++ b/docs/grid.md @@ -0,0 +1,118 @@ +# Grid Documentation + +## Features + +- 12-column layout system +- Responsive breakpoints: sm (576px), md (768px), lg (992px), xl (1200px) +- Fluid and fixed-width containers +- Offsets for column positioning +- No-gutters option to remove spacing +- Based on Flexbox for modern layout capabilities + +## Basic Usage + +### Container + +Wrap your content in a container: + +```html +
One stop shop for quick debugging and edge-case tests of CSS.
-Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet - non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus - mus.
-Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet - non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus - mus.
-Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet - non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus - mus.
-Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet - non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus - mus.
-Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet - non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus - mus.
-Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet - non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus - mus.
-Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet - non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus - mus.
-1 | -2 | -3 | -
1 | -2 | -3 | -
1 | -2 | -3 | -
1 | -2 | -3 | -
1 | -2 | -3 | -
1 | -2 | -3 | -
1 | -2 | -3 | -
1 | -2 | -3 | -
1 | -2 | -3 | -
3 | -6 | -9 | -
A | -B | -C | -
---|---|---|
1 | -2 | -3 | -
1 | -2 | -3 | -
1 | -2 | -3 | -
3 | -6 | -9 | -
1 | -2 | -3 | -
---|---|---|
1 | -2 | -3 | -
1 | -2 | -3 | -
1 | -2 | -3 | -
3 | -6 | -9 | -
1 | -2 | -3 | -
---|---|---|
1 and 2 | -3 | -|
1 | -2 | -3 | -
1 | -3 | -|
2 and 3 | -
1 | -2 | -3 | -
---|---|---|
1 and 2 | -3 | -|
1 | -2 | -3 | -
1 | -3 | -|
2 and 3 | -
Test | -||||||||
---|---|---|---|---|---|---|---|---|
-
|
-
1 | -2 | -3 | -
---|---|---|
1 and 2 | -3 | -|
1 | -2 | -3 | -
1 | -3 | -|
2 and 3 | -
Inputs should not extend past the light red background, set on their parent, a .span*
- column.
Inputs should not extend past the light red background, set on their parent, a .span*
- column.
I'm in Section 1.
- -I'm in Section 1.1.
-I'm in Section 1.2.
-I'm in Section 1.3.
-Howdy, I'm in Section 2.
-What up girl, this is Section 3.
-Cras justo odio, dapibus ac facilisis in, egestas eget quam. Maecenas sed diam Label name eget risus varius blandit sit amet non magna.
- Fusce .class-name
dapibus, tellus ac cursus commodo, tortor mauris condimentum
- nibh, ut fermentum massa justo sit amet risus.
- Maecenas faucibus mollis interdum. Nulla vitae elit libero, a pharetra augue. Donec - ullamcorper nulla non metus auctor fringilla. Fusce dapibus, tellus ac cursus commodo, - tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. - | -
-
-
-
-
-
-
- |
-
Alert! Best check yourself, you're not looking too good.
-Success! Best check yourself, you're not looking too good.
-Info! Best check yourself, you're not looking too good.
-Warning! Best check yourself, you're not looking too good.
-Error! Best check yourself, you're not looking too good.
-This example is a quick exercise to illustrate how the default, static navbar and fixed to top navbar - work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.
- -This example is a quick exercise to illustrate how the default, static navbar and fixed to top navbar - work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.
- -