Make nav sticky for blog template

This commit is contained in:
thiloho
2024-08-25 18:47:20 +02:00
parent 926218fa34
commit 8ea7f7b4a3
2 changed files with 24 additions and 3 deletions

View File

@@ -35,8 +35,7 @@ SECURITY DEFINER;
GRANT EXECUTE ON FUNCTION api.upload_file (BYTEA) TO authenticated_user; GRANT EXECUTE ON FUNCTION api.upload_file (BYTEA) TO authenticated_user;
-- migrate:down -- migrate:down
DROP FUNCTION api.upload_file (BYTEA);
DROP FUNCTION api.upload_file(BYTEA);
CREATE FUNCTION api.upload_file (BYTEA, OUT file_id UUID) CREATE FUNCTION api.upload_file (BYTEA, OUT file_id UUID)
AS $$ AS $$
@@ -72,3 +71,4 @@ LANGUAGE plpgsql
SECURITY DEFINER; SECURITY DEFINER;
GRANT EXECUTE ON FUNCTION api.upload_file (BYTEA) TO authenticated_user; GRANT EXECUTE ON FUNCTION api.upload_file (BYTEA) TO authenticated_user;

View File

@@ -3,12 +3,29 @@
inline-size: min(100% - var(--space-m), 75ch); inline-size: min(100% - var(--space-m), 75ch);
} }
nav {
position: sticky;
block-size: var(--space-xl);
display: flex;
align-items: center;
inset-block-start: 0;
background-color: var(--bg-primary);
border-block-end: var(--border-primary);
}
header > .container { header > .container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: var(--space-s); gap: var(--space-s);
} }
header img {
inline-size: 100%;
block-size: 300px;
object-fit: cover;
object-position: center;
}
nav, nav,
header, header,
main, main,
@@ -34,3 +51,7 @@ footer {
.table-of-contents { .table-of-contents {
margin-block-end: var(--space-s); margin-block-end: var(--space-s);
} }
section {
scroll-margin-block-start: var(--space-xl);
}