Skip to content

Commit

Permalink
Improve Styling, Added Next Page Buttons, Added Coverpage (#650)
Browse files Browse the repository at this point in the history
* some progress on styling

* backgroud fix on lightmode
  • Loading branch information
Shubhaankar-Sharma authored Aug 27, 2021
1 parent 1ce2c21 commit 93c034a
Show file tree
Hide file tree
Showing 6 changed files with 278 additions and 12 deletions.
10 changes: 5 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# chi

## 👋 Hi, Let's Get You Started With chi
## 👋 Hi, Let's Get You Started With chi <!-- {docsify-ignore} -->

<!-- # chi -->

Expand All @@ -19,7 +19,7 @@ parts. The core router `github.com/go-chi/chi` is quite small (less than 1000 LO
included some useful/optional subpackages: [middleware](https://github.com/go-chi/chi/tree/master/middleware), [render](https://github.com/go-chi/render)
and [docgen](https://github.com/go-chi/docgen). We hope you enjoy it too!

## Features
## Features <!-- {docsify-ignore} -->

* **Lightweight** - cloc'd in ~1000 LOC for the chi router
* **Fast** - yes, see [benchmarks](https://github.com/go-chi/chi#benchmarks)
Expand All @@ -33,16 +33,16 @@ and [docgen](https://github.com/go-chi/docgen). We hope you enjoy it too!



## Examples
## Examples <!-- {docsify-ignore} -->

See [examples](https://github.com/go-chi/chi/blob/master/_examples/) for a variety of examples.


## License
## License <!-- {docsify-ignore} -->

Copyright (c) 2015-present [Peter Kieltyka](https://github.com/pkieltyka)

Licensed under [MIT License](./LICENSE)
Licensed under [MIT License](https://github.com/go-chi/chi/blob/master/LICENSE)

[GoDoc]: https://pkg.go.dev/github.com/go-chi/chi?tab=versions
[GoDoc Widget]: https://godoc.org/github.com/go-chi/chi?status.svg
Expand Down
17 changes: 17 additions & 0 deletions docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
![logo](https://cdn.rawgit.com/go-chi/chi/master/_examples/chi.svg)

> A lightweight, idiomatic and composable router for building Go HTTP services.
- 🚀 Lightweight
- ⚡️️ Fast
- 🔥 Robust
- 📼 No external dependencies

<div class="buttons">
<a href="https://github.com/go-chi/chi/" target="_blank"><span>GitHub</span></a>
<a href="#/README"><span>Get Started</span></a>
</div>

<!-- background color -->

![color](#000000)
11 changes: 9 additions & 2 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@
- [Mounting Routers and Sub Routers]()
- [Middleware]() -->
<!-- docs/advanced_user_guide/_sidebar.md -->
- [📚 User Guide](user_guide/index.md)
- [👋 Introduction](README.md)
- [⚡ Getting Started](user_guide/first_steps.md)
- [🔌 Routing](user_guide/routing.md)
- [🧬 Middleware](user_guide/middleware.md)
- [🧪 Testing](user_guide/testing.md)
- [🍳 Examples](https://github.com/go-chi/chi/tree/master/_examples)
- [⚖️ License](https://github.com/go-chi/chi/blob/master/LICENSE)
<!-- - [📚 User Guide](user_guide/index.md)
- [👋 First Steps](user_guide/first_steps.md)
- [🔌 Routing](user_guide/routing.md)
- [🧬 Middleware](user_guide/middleware.md)
- [🧪 Testing](user_guide/testing.md)
- [🍳 Examples](https://github.com/go-chi/chi/tree/master/_examples)
- [🍳 Examples](https://github.com/go-chi/chi/tree/master/_examples) -->
Binary file added docs/assets/chi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
227 changes: 227 additions & 0 deletions docs/assets/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
/****** Cover Page ******/
section.cover {
padding-bottom: 112px; /* fixed footer (Netflix) height */
height: auto;
min-height: 100vh;
color: var(--textColor);
}

section.cover .cover-main {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
margin: 0;
padding: 32px 16px 0;
}

section.cover img {
width: 400px;
}

section.cover h1 {
margin: 0.625rem 0 1rem;
}

section.cover blockquote,
section.cover blockquote p {
margin: 0;
}

section.cover ul {
font-size: 1.25rem;
line-height: 2rem;
display: grid;
text-align: left;
grid-column-gap: 16px;
grid-row-gap: 20px;
grid-template-columns: repeat(2, 50%);
list-style: none;
max-width: unset;
margin: 1.5em 0;
}

section.cover ul li {
white-space: nowrap;
}

section.cover.show ~ .sidebar,
section.cover.show ~ .sidebar-toggle {
display: none;
}


.cover-main .buttons {
width: 100%;
}

.cover-main .buttons a {
font-weight: 700;
position: relative;
display: inline-block;
padding: 12px 25px;
font-size: 14px;
text-align: center;
line-height: 18px;
color: #221f1f;
background: var(--coverBackground);
outline: none;
border: none;
background-color: var(--coverBackground);
-webkit-appearance: none;
-moz-appearance: none;
cursor: pointer;
margin: 0 1rem;
color: var(--theme-color);
overflow: hidden;
transition: color 0.25s cubic-bezier(0.215, 0.61, 0.355, 1);
vertical-align: baseline;
text-transform: uppercase;
}

.cover-main .buttons a:before,
.cover-main .buttons a:after {
content: '';
display: block;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
border: 2px solid var(--theme-color);
box-sizing: border-box;
}

.cover-main .buttons a:after {
background: var(--theme-color);
transform: translateX(-101%);
transition: all 0.2s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.cover-main .buttons a:hover {
color: white;
box-shadow: 0 5px 16px rgba(229, 9, 20, 0.3);
}

.cover-main .buttons a:hover:after {
transform: translateX(0);
}

.cover-main .buttons a span {
position: relative;
z-index: 1;
}

@media (max-width: 850px) {
section.cover ul {
grid-template-columns: 100%;
padding: 0;
}

section.cover ul li {
text-align: center;
}
}

@media (max-width: 450px) {
section.cover ul li {
white-space: normal;
}

.cover-main .buttons a {
width: 100%;
margin: 0.2rem 0;
}
}


/****** Sidebar ******/
.sidebar .app-name-link img {
height: 150px;
}

.sidebar ul li a {
font-size: 15px;
}

.sidebar ul li a:hover {
color: var(--theme-color);
}

.app-sub-sidebar li:before {
display: none;
}

.sidebar .search .clear-button {
cursor: pointer;
}

/****** Sidebar Toggle ******/
.sidebar-toggle {
cursor: pointer;
}

body .sidebar-toggle {
background: none;
top: 1.5rem;
left: calc(300px + 1.5rem);
cursor: pointer;
width: 1.5rem;
height: 1.5rem;
padding: 0;
transition: left 0.25s ease-out;
}

body .sidebar-toggle span {
background-color: var(--theme-color);
height: 0.2rem;
width: 1.5rem;
position: absolute;
left: 0;
margin: 0;
transform-origin: 0;
border-radius: 1px;
}

body.close .sidebar-toggle {
transition: left 0.25s ease-out;
width: 1.5rem;
height: 1.5rem;
left: 1.5rem;
}

body.close .sidebar-toggle span {
transform-origin: center;
}

body .sidebar-toggle span:nth-child(1) {
top: 0;
}
body .sidebar-toggle span:nth-child(2) {
top: 0.5rem;
}
body .sidebar-toggle span:nth-child(3) {
top: 1rem;
}

.sidebar-toggle:hover {
opacity: 0.8;
}
.sidebar-toggle .sidebar-toggle-button:hover {
opacity: 1;
}

@media screen and (max-width: 768px) {
body .sidebar-toggle {
left: 1rem;
}

body.close .sidebar-toggle {
left: calc(300px + 1.5rem);
}
}

/****** COPY TO CLIPBOARD ******/
.docsify-copy-code-button {
font-size: 0.7em !important;
}
25 changes: 20 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@
<meta property="og:description" content="A lightweight, idiomatic and composable router for building Go HTTP services." />
<meta name="description" content="A lightweight, idiomatic and composable router for building Go HTTP services." />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<meta property="og:image" content="https://cdn.rawgit.com/go-chi/chi/master/_examples/chi.svg" />
<meta property="og:image" content="assets/chi.png" />
<meta name="twitter:card" content="summary_large_image">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify@4.12.1/lib/themes/vue.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-darklight-theme@3.2.0/dist/style.min.css" integrity="sha256-iCuOxtYWNr4wPKxT7rWzyHs8b8JcY7hK++1DtQ5S8uM=" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/styles.css" />
</head>
<body>
<div id="app">Loading ...</div>
<div id="app"></div>
<!-- set dark mode if not already set -->
<script>
if (!localStorage.getItem('DARK_LIGHT_THEME')){
Expand All @@ -33,6 +34,9 @@
repo: 'go-chi/chi',
loadSidebar: true,
subMaxLevel: 3,
coverpage: true,
onlyCover: true,
homepage: 'README.md',
logo: 'https://cdn.rawgit.com/go-chi/chi/master/_examples/chi.svg',
themeColor: '#14b853',
darklightTheme: {
Expand All @@ -41,16 +45,27 @@
siteFont : "'Open Sans'",
dark: {
textColor: '#ffffff',
blockQuoteColor: '#999999'
blockQuoteColor: '#999999',
coverBackground : '##091a28',
},
light: {
coverBackground : '#fafafa',
}
},
search: {
paths: 'auto',
placeholder: 'Search',
noData: 'No Results.'
},
routerMode: 'hash'
}
};
</script>
</script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/docsify-darklight-theme@3.2.0/dist/index.min.js" integrity="sha256-u0+KcSs8hp4Wdux9vSi71vUSR1brxvnxL+2I5Vfie+0=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/docsify@4.12.1/lib/docsify.min.js" integrity="sha256-SMbD6TUjXm39IIYG4s98d3aewAnhceOeHXIEG2EfCOs=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/docsify-copy-code@2.1.1/dist/docsify-copy-code.min.js" integrity="sha256-8RM7T/q4FqeRqHqvRITDUFPFrMuFyE+PpeaFpdLM0Fw=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/components/prism-go.min.js" integrity="sha256-jMFHuzUuIKDkiWxVNKgt9Pb+39LspOzv3+atXNO3SNo=" crossorigin="anonymous"></script>
<script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
</body>
</html>

0 comments on commit 93c034a

Please sign in to comment.