Skip to content

Commit

Permalink
[docs] Improve doc readability by changing the theme and style (ddev#…
Browse files Browse the repository at this point in the history
…4009)

* Set theme to indigo as light-blue has a too low contrast ratio for a lot of elements
* Organize extra.css and override some default styling to improve readability on the docs
* Fix main menu contrast
* Increase mobile tab buttons size

Co-authored-by: Gilbertsoft <[email protected]>
  • Loading branch information
mikesnoeren and gilbertsoft authored Aug 16, 2022
1 parent 3703a94 commit 26d8174
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 7 deletions.
107 changes: 101 additions & 6 deletions docs/content/assets/extra.css
Original file line number Diff line number Diff line change
@@ -1,23 +1,118 @@
/* variables */
:root {
/* #4051b5 (indigo primary) in decimal RGB */
--custom-bg-color: rgba(64, 81, 181, .1);
}

/* table does not need a scrollbar, see https://github.com/drud/ddev/pull/3290#issuecomment-942888867
*/
.md-typeset__table {
padding-right: 0;
padding-right: 0;
}

dt {
font-weight: bold;
font-weight: bold;
}

.md-typeset :is(.admonition,details) {
font-size: .70rem;
background-color: inherit;
font-size: .70rem;
background-color: inherit;
}

.md-typeset .tabbed-content {
background-color: aliceblue;
padding: 10px;
background-color: var(--custom-bg-color);
padding: 10px;
}

/* only required if we have our svg logo out there */
/*.md-logo {*/
/* filter:invert(40%)*/
/*}*/

/* typography */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
font-weight: 700;
margin-bottom: .5em;
color: var(--md-primary-fg-color);
}

.md-content {
max-width: 130ch;
}

/* main menu */
.md-container > nav .md-tabs__item {
position: relative !important;
height: 2rem;
display: inline-flex;
justify-content: center;
align-items: center;
}

.md-container > nav .md-tabs__link {
margin-top: 0;
}

.md-container > nav .md-tabs__link:after {
content: '';
background: #fff;
opacity: 0;
position: absolute;
right: 0;
bottom: 0;
left: 0;
top: 0;
}

.md-container > nav .md-tabs__link:hover:after,
.md-container > nav .md-tabs__link--active:after {
opacity: 0.1;
}

.md-tabs[hidden] .md-tabs__link,
.md-container > nav .md-tabs[hidden] .md-tabs__link {
transform: unset;
transition: opacity .3s ease;
}

/* blockquote */
[dir=ltr] .md-typeset blockquote {
border-left-color: var(--md-primary-fg-color);
background: var(--custom-bg-color);
padding: .6rem 1rem;
}

[dir=ltr] .md-typeset blockquote strong {
color: var(--md-primary-fg-color);
}

[dir=ltr] .md-typeset blockquote p:first-child {
margin-top: 0;
}

[dir=ltr] .md-typeset blockquote p:last-child {
margin-bottom: 0;
}

/* tabs */
.md-typeset .tabbed-labels label {
font-size: 0.75rem;
}

.md-typeset .tabbed-button {
width: 30px;
height: 100%;
border-radius: unset!important;
}

.md-typeset .tabbed-button:after {
-webkit-mask-size: cover;
mask-size: cover;
mask-position: center;
-webkit-mask-position: center;
}
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ theme:
name: material
palette:
- scheme: default
primary: light-blue
primary: indigo
accent: indigo
features:
# - content.tabs.link
Expand Down

0 comments on commit 26d8174

Please sign in to comment.