Skip to content

Commit

Permalink
make headings links, use more tw classes
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostlylake committed Jun 17, 2024
1 parent a2857a9 commit 5a4db30
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 17 deletions.
21 changes: 19 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import tailwind from '@astrojs/tailwind';
import { rehypeHeadingIds } from '@astrojs/markdown-remark';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import starlightLinksValidator from 'starlight-links-validator';
import { links, } from './src/config';

// https://astro.build/config
export default defineConfig({
site: 'https://starboardbot.github.io',
base: '/docs',
markdown: {
rehypePlugins: [
rehypeHeadingIds,
[
rehypeAutolinkHeadings,
{
behavior: 'wrap',
properties: {
tabIndex: -1,
class: 'heading-link',
},
},
],
],
},
integrations: [
starlight({
title: 'Starboard',
Expand All @@ -19,7 +36,7 @@ export default defineConfig({
},
sidebar: [
{
label: "About",
label: 'About',
autogenerate: {
directory: '/about/',
},
Expand All @@ -31,7 +48,7 @@ export default defineConfig({
},
},
{
label: "Settings",
label: 'Settings',
autogenerate: {
directory: '/settings/',
},
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
},
"dependencies": {
"@astrojs/check": "^0.7.0",
"@astrojs/markdown-remark": "^5.1.0",
"@astrojs/starlight": "^0.24.2",
"@astrojs/starlight-tailwind": "^2.0.3",
"@astrojs/tailwind": "^5.1.0",
"@fontsource-variable/lexend": "^5.0.20",
"astro": "^4.10.2",
"rehype-autolink-headings": "^7.1.0",
"sharp": "^0.32.5",
"starlight-links-validator": "^0.9.0",
"tailwindcss": "^3.4.4",
Expand Down
27 changes: 25 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 20 additions & 13 deletions src/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ https://tailwindcss.com/docs/adding-custom-styles#using-css-and-layer
/* Fonts */
:root {
--sl-font: Lexend Variable;
font-weight: 300;
@apply font-light;
}

:root {
Expand All @@ -23,8 +23,7 @@ nav:has(#starlight__on-this-page) ul li {
}

h1 {
font-weight: 700;
@apply text-center xl:text-start
@apply text-center xl:text-start font-bold
}


Expand All @@ -33,7 +32,7 @@ h1 {
}

.content-panel {
border: none !important;
@apply !border-none
}

.starlight-aside {
Expand Down Expand Up @@ -77,26 +76,34 @@ h1 {

/* Twemoji */
img.emoji {
height: 1.2em;
width: 1.2em;
margin: 0 .05em 0 .1em !important;
vertical-align: -0.1em;

@apply inline-flex;
@apply inline-flex h-[1.2em] w-[1.2em];
}

#command img.emoji {
@apply align-super;
height: 1.5em;
width: 1.5em;
@apply align-super h-5 w-5;
}

#option img.emoji {
margin-top: auto !important;
margin-bottom: auto !important;
@apply !my-auto;
}

/* markdown */
code {
@apply rounded-sm
}
}

/* heading link styling */
.heading-link::after {
@apply opacity-0 ps-2 transition-all duration-300 content-['#'] text-[color:var(--sl-color-text-accent)];
}

.heading-link:hover::after {
@apply opacity-100;
}

.heading-link {
@apply no-underline !text-[color:var(--sl-color-white)];
}

0 comments on commit 5a4db30

Please sign in to comment.