Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
sfoo-iohk committed Jan 2, 2024
1 parent 0c4bb05 commit dec95cb
Show file tree
Hide file tree
Showing 8 changed files with 216 additions and 148 deletions.
182 changes: 102 additions & 80 deletions theme/assets/marlowe-theme.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* https://github.com/elad2412/the-new-css-reset */
*:where(:not(html, iframe, canvas, img, svg, video, audio):not(svg *, symbol *)) {
*:where(
:not(html, iframe, canvas, img, svg, video, audio):not(svg *, symbol *)
) {
all: unset;
display: revert;
}
Expand All @@ -12,12 +14,15 @@
}

/* Reapply the pointer cursor for anchor tags */
a, button {
a,
button {
cursor: revert;
}

/* Remove list styles (bullets/numbers) */
ol, ul, menu {
ol,
ul,
menu {
list-style: none;
}

Expand Down Expand Up @@ -74,7 +79,8 @@ meter {
--light-button-color-hover: rgb(36, 41, 47);
--light-button-background-hover: rgb(239, 241, 243);
--light-button-border-color-hover: rgba(31, 35, 40, 0.15);
--light-button-box-shadow: rgba(31, 35, 40, 0.04) 0 1px 0, rgba(255, 255, 255, 0.25) 0 1px 0 inset;
--light-button-box-shadow: rgba(31, 35, 40, 0.04) 0 1px 0,
rgba(255, 255, 255, 0.25) 0 1px 0 inset;
--light-input-border-color: rgb(208, 215, 222);
--light-input-border-color-focus: rgb(9, 105, 218);

Expand All @@ -98,8 +104,10 @@ meter {
--pre-color-background: var(--color-background-secondary);
--code-color-background: var(--color-background-secondary);

--font-family-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
--font-family-mono: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
--font-family-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
--font-family-mono: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas,
Liberation Mono, monospace;

--font-size-h1: 2.1rem;
--font-size-h2: 1.8rem;
Expand All @@ -126,33 +134,33 @@ meter {

@media (prefers-color-scheme: light) {
:root {
--select-chevron: var(--light-select-chevron);
--code-color-background: var(--light-code-color-background);
--button-color: var(--light-button-color);
--button-background: var(--light-button-background);
--button-border-color: var(--light-button-border-color);
--button-color-hover: var(--light-button-color-hover);
--button-background-hover: var(--light-button-background-hover);
--button-border-color-hover: var(--light-button-border-color-hover);
--button-box-shadow: var(--light-button-box-shadow);
--input-border-color: var(--light-input-border-color);
--input-border-color-focus: var(--light-input-border-color-focus);
--select-chevron: var(--light-select-chevron);
--code-color-background: var(--light-code-color-background);
--button-color: var(--light-button-color);
--button-background: var(--light-button-background);
--button-border-color: var(--light-button-border-color);
--button-color-hover: var(--light-button-color-hover);
--button-background-hover: var(--light-button-background-hover);
--button-border-color-hover: var(--light-button-border-color-hover);
--button-box-shadow: var(--light-button-box-shadow);
--input-border-color: var(--light-input-border-color);
--input-border-color-focus: var(--light-input-border-color-focus);
}
}

@media (prefers-color-scheme: dark) {
:root {
--select-chevron: var(--dark-select-chevron);
--code-color-background: var(--dark-code-color-background);
--button-color: var(--dark-button-color);
--button-background: var(--dark-button-background);
--button-border-color: var(--dark-button-border-color);
--button-color-hover: var(--dark-button-color-hover);
--button-background-hover: var(--dark-button-background-hover);
--button-border-color-hover: var(--dark-button-border-color-hover);
--button-box-shadow: var(--dark-button-box-shadow);
--input-border-color: var(--dark-input-border-color);
--input-border-color-focus: var(--dark-input-border-color-focus);
--select-chevron: var(--dark-select-chevron);
--code-color-background: var(--dark-code-color-background);
--button-color: var(--dark-button-color);
--button-background: var(--dark-button-background);
--button-border-color: var(--dark-button-border-color);
--button-color-hover: var(--dark-button-color-hover);
--button-background-hover: var(--dark-button-background-hover);
--button-border-color-hover: var(--dark-button-border-color-hover);
--button-box-shadow: var(--dark-button-box-shadow);
--input-border-color: var(--dark-input-border-color);
--input-border-color-focus: var(--dark-input-border-color-focus);
}
}

Expand Down Expand Up @@ -189,11 +197,13 @@ body {
line-height: var(--line-height);
}

b, strong {
b,
strong {
font-weight: 600;
}

i, em {
i,
em {
font-style: italic;
}

Expand Down Expand Up @@ -231,7 +241,10 @@ select:focus {
box-shadow: 0 0 0 1px var(--input-border-color-focus);
}

dl, menu, ol, ul {
dl,
menu,
ol,
ul {
margin: 0 0 var(--header-margin) 0;
}

Expand Down Expand Up @@ -285,7 +298,8 @@ table {
max-width: 100%;
}

th, td {
th,
td {
padding: var(--table-padding);
}

Expand Down Expand Up @@ -494,7 +508,8 @@ ul.tsd-parameter-list > li > h5:last-child {

/* Show parameter signature as a cut-in block */
.tsd-parameter-signature {
margin: calc(var(--paragraph-spacing) / -2) calc(var(--paragraph-spacing) * -1) calc(var(--paragraph-spacing) / 2);
margin: calc(var(--paragraph-spacing) / -2)
calc(var(--paragraph-spacing) * -1) calc(var(--paragraph-spacing) / 2);
padding: var(--paragraph-spacing);
padding-bottom: 0.05px;
background: var(--color-background-secondary);
Expand Down Expand Up @@ -774,7 +789,6 @@ a.tsd-index-link {
flex-grow: 1;
padding: 0.3em var(--toolbar-icon-width) 0.3em 0.7em;
border: solid 1px rgb(208, 215, 222);
background-color: ;
}

#tsd-search .field input:focus {
Expand Down Expand Up @@ -859,82 +873,90 @@ a.tsd-index-link {

@media (max-width: 769px) {
:root {
--font-size-h1: 1.8rem;
--font-size-h2: 1.5rem;
--font-size-h3: 1.3rem;
--font-size-aside: 0.875rem;
--header-height: 3rem;
--line-height: 1.5;
--member-group-spacing: 2rem;
--member-spacing: 1.5rem;
--paragraph-spacing: 0.5rem;
--header-margin: 1rem 0 0.5rem 0;
--term-spacing: 0.2rem;
--list-spacing: 1rem;
--menu-spacing-vertical: 0.4rem;
--menu-spacing-horizontal: 1.5rem;
--header-border-spacing: 0.1rem;
--border-radius: 0.35rem;
--table-padding: 0.5rem;
--content-spacing: 1.2rem;
--anchor-icon-offset: -1.1rem;
--anchor-icon-size: 1.1rem;
--font-size-h1: 1.8rem;
--font-size-h2: 1.5rem;
--font-size-h3: 1.3rem;
--font-size-aside: 0.875rem;
--header-height: 3rem;
--line-height: 1.5;
--member-group-spacing: 2rem;
--member-spacing: 1.5rem;
--paragraph-spacing: 0.5rem;
--header-margin: 1rem 0 0.5rem 0;
--term-spacing: 0.2rem;
--list-spacing: 1rem;
--menu-spacing-vertical: 0.4rem;
--menu-spacing-horizontal: 1.5rem;
--header-border-spacing: 0.1rem;
--border-radius: 0.35rem;
--table-padding: 0.5rem;
--content-spacing: 1.2rem;
--anchor-icon-offset: -1.1rem;
--anchor-icon-size: 1.1rem;
}

h1, h2, h3, h4, h5, h6 {
word-break: break-word;
h1,
h2,
h3,
h4,
h5,
h6 {
word-break: break-word;
}

.col-sidebar {
gap: 0 !important;
padding: var(--paragraph-spacing) !important;;
overflow-y: auto;
overflow-x: hidden;
gap: 0 !important;
padding: var(--paragraph-spacing) !important;
overflow-y: auto;
overflow-x: hidden;
}

.site-menu {
padding: var(--paragraph-spacing) 0 0 0 !important;
padding: var(--paragraph-spacing) 0 0 0 !important;
}

.tsd-page-toolbar .tsd-toolbar-icon.menu {
display: flex;
display: flex;
}
}

@media (min-width: 770px) and (max-width: 1399px) {
.col-sidebar {
padding: var(--paragraph-spacing) 0;
max-height: calc(100vh - var(--header-height));
overflow-y: auto;
overflow-x: hidden;
position: sticky;
top: var(--header-height);
padding: var(--paragraph-spacing) 0;
max-height: calc(100vh - var(--header-height));
overflow-y: auto;
overflow-x: hidden;
position: sticky;
top: var(--header-height);
}

.page-menu {
padding: 0 0 0 var(--content-spacing);
margin: 0 0 var(--paragraph-spacing) 0;
padding: 0 0 0 var(--content-spacing);
margin: 0 0 var(--paragraph-spacing) 0;
}

.site-menu {
padding: 0 0 0 var(--content-spacing);
margin: 0;
padding: 0 0 0 var(--content-spacing);
margin: 0;
}
}

@media (min-width: 1200px) {
.page-menu, .site-menu {
max-height: calc(100vh - var(--header-height));
overflow: auto;
position: sticky;
top: var(--header-height);
.page-menu,
.site-menu {
max-height: calc(100vh - var(--header-height));
overflow: auto;
position: sticky;
top: var(--header-height);
}

.page-menu {
padding: var(--paragraph-spacing) var(--content-spacing) var(--paragraph-spacing) 0;
padding: var(--paragraph-spacing) var(--content-spacing)
var(--paragraph-spacing) 0;
}

.site-menu {
padding: var(--paragraph-spacing) 0 var(--paragraph-spacing) var(--content-spacing);
padding: var(--paragraph-spacing) 0 var(--paragraph-spacing)
var(--content-spacing);
}
}
}
6 changes: 3 additions & 3 deletions theme/src/MarloweTheme.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { DefaultTheme, JSX, PageEvent, Reflection } from 'typedoc';
import { ThemeContext } from './ThemeContext';
import { DefaultTheme, JSX, PageEvent, Reflection } from "typedoc";
import { ThemeContext } from "./ThemeContext";

export class MarloweTheme extends DefaultTheme {
override getRenderContext(pageEvent: PageEvent<Reflection>): ThemeContext {
return new ThemeContext(this, pageEvent, this.application.options);
}
}
}
28 changes: 16 additions & 12 deletions theme/src/ThemeContext.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
import {
DefaultTheme,
DefaultThemeRenderContext,
JSX,
Options,
PageEvent,
Reflection,
} from 'typedoc';
import * as templates from './templates';
DefaultTheme,
DefaultThemeRenderContext,
JSX,
Options,
PageEvent,
Reflection,
} from "typedoc";
import * as templates from "./templates";

function bind<F, L extends any[], R>(fn: (f: F, ...a: L) => R, first: F) {
return (...r: L) => fn(first, ...r);
}

export class ThemeContext extends DefaultThemeRenderContext {
constructor(theme: DefaultTheme, page: PageEvent<Reflection>, options: Options) {
constructor(
theme: DefaultTheme,
page: PageEvent<Reflection>,
options: Options
) {
super(theme, page, options);
this.init();
}
init(){
init() {
for (const [key, tpl] of Object.entries(templates)) {
this[key as keyof ThemeContext] = bind(tpl as any, this) as any;
}
}
}
}
Loading

0 comments on commit dec95cb

Please sign in to comment.