Skip to content

Commit 7062cec

Browse files
authored
fix: add configurable content padding (#70)
- makes main content x padding configurable - sets pattern for making other common css values configurable w/o needing custom css or templates
1 parent 49baed0 commit 7062cec

7 files changed

Lines changed: 23 additions & 2 deletions

File tree

docs/Customization.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,23 @@ layout: talk
5353

5454
This resolves to `layouts/talk.html`. Resolution order: frontmatter `layout` → collection default → `[theme] default_layout``layouts/default.html`.
5555

56+
## Theme Options
57+
58+
The `[theme]` table includes options that control the default layout appearance.
59+
60+
### Content Padding
61+
62+
Control the horizontal padding of the main content area with a Tailwind CSS padding class:
63+
64+
```toml
65+
[theme]
66+
main_content_padding = "px-12"
67+
```
68+
69+
Default: `px-12`. Pre-built values available without a custom CSS build: `px-4`, `px-6`, `px-8`, `px-10`, `px-12`, `px-16`, `px-20`, `px-24`. The class is applied at the `lg` breakpoint; mobile padding remains `p-4`.
70+
71+
For values outside this range, you'll need a custom Tailwind CSS build — see [Custom Themes](#custom-themes) or export the default theme with `rockgarden theme export`.
72+
5673
## Theme Export
5774

5875
To fully customize the default theme, export it as a starting point:

rockgarden.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ source = "./site"
44
output = "./_site"
55

66
[theme]
7+
#main_content_padding = "px-16"
78
daisyui_default = "cyberpunk"
89
daisyui_themes = ["light", "dark", "cupcake", "cyberpunk", "forest", "aqua", "lofi", "dracula"]

src/rockgarden/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class ThemeConfig(BaseModel):
7171
nav_default_state: str = "collapsed"
7272
show_build_info: bool = True
7373
show_build_commit: bool = False
74+
main_content_padding: str = "px-12"
7475

7576

7677
class NavLinkConfig(BaseModel):

src/rockgarden/output/builder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ def build_site(
474474
"user_styles": user_styles,
475475
"user_scripts": user_scripts,
476476
"assets_dir": assets_dir,
477+
"main_content_padding": config.theme.main_content_padding,
477478
"feed_enabled": config.feed.enabled and bool(config.site.base_url),
478479
"feed_path": config.feed.path,
479480
}

src/rockgarden/static/rockgarden.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rockgarden/templates/layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
<!-- Main content area -->
3333
<div class="flex flex-1 lg:min-h-screen">
34-
<main id="main-content" class="flex-1 min-w-0 p-4 lg:py-6 lg:px-8">
34+
<main id="main-content" class="flex-1 min-w-0 p-4 lg:py-6 lg:{{ site.main_content_padding }}">
3535
<div class="max-w-4xl">
3636
{% block content %}{% endblock %}
3737
{% block footer %}

static-src/input.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import "tailwindcss";
2+
@source inline("px-4 px-6 px-8 px-10 px-12 px-16 px-20 px-24 lg:px-4 lg:px-6 lg:px-8 lg:px-10 lg:px-12 lg:px-16 lg:px-20 lg:px-24");
23
@plugin "@tailwindcss/typography";
34
@plugin "daisyui" {
45
themes: all;

0 commit comments

Comments
 (0)