Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api-reference): allow users to add custom header / footers easily #1899

Closed
wants to merge 3 commits into from

Conversation

cameronrohani
Copy link
Contributor

@cameronrohani cameronrohani commented May 29, 2024

This is a draft proposal to allow users to easily add custom headers and footers

unlike the other wonderful solutions this one relies on removing scroll from .scalar-api-reference and instead using the body for scrolling.

Why this instead of the other?

Some users require scrolling of the whole page rather than just .scalar-api-reference which creates double scrollbars on the website when they embed scalar, this fixes that.

demo:

headerfootervid.mov

if we choose to go with this approach there remains some todo's:

  • create better documentation on how to add header / footers
  • remove overflow:hidden in /scalar-org so this approach will work
  • remove some redundant code from scalasusaurus

Copy link

changeset-bot bot commented May 29, 2024

⚠️ No Changeset found

Latest commit: 8ad1786

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

relativeci bot commented May 29, 2024

#1990 Bundle Size — 1.95MiB (+0.05%).

8ad1786(current) vs 68eede9 main#1985(baseline)

Warning

Bundle contains 4 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#1990
     Baseline
#1985
Regression  Initial JS 1.95MiB(+0.05%) 1.95MiB
No change  Initial CSS 0B 0B
No change  Cache Invalidation 100% 100%
No change  Chunks 1 1
No change  Assets 1 1
Change  Modules 1040(-0.29%) 1043
No change  Duplicate Modules 0 0
No change  Duplicate Code 0% 0%
No change  Packages 157 157
No change  Duplicate Packages 4 4
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#1990
     Baseline
#1985
Regression  JS 1.95MiB (+0.05%) 1.95MiB

Bundle analysis reportBranch cam/fix-allow-custom-header-foot...Project dashboard

@marclave marclave marked this pull request as ready for review June 11, 2024 16:44
@marclave marclave self-requested a review as a code owner June 11, 2024 16:44
Copy link
Contributor

@@ -70,6 +70,20 @@ useResizeObserver(documentEl, (entries) => {
elementHeight.value = entries[0].contentRect.height + 'px'
})

const yPosition = ref(0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oooo we shouldn't calculate style in js. doesn't work on SSR. Can we use only css instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They could technically overwrite the position with --scalar-y-offset if they had a custom header so could be fine?

@hanspagel hanspagel changed the title fix: allow users to add custom header / footers easily fix(api-reference): allow users to add custom header / footers easily Jun 13, 2024
@hanspagel
Copy link
Member

Is that an alternative solution to #1775?

@marclave
Copy link
Member

closed in favour of #2198

@marclave marclave closed this Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants