mui / mui/material-ui

[typography] Built-in scrollMarginTop support

Open
#33,282 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

on hold package: joy-ui scope: typography type: new feature waiting for 👍
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Summary 💡

Improve the scroll top integration of scrollMarginTop with the Typography.

Examples 🌈

I'm not sure what's the best way to abstract this, but I wonder if it wouldn't make a lot of sense to, once/if the Typography component is moved to @mui/system, to:

  1. Add a minimum value of scrollMarginTop to 8px so it doesn't scroll like this:
Screenshot 2022-06-24 at 20 15 23

but like this (better default when there are no sticky headers):

Screenshot 2022-06-24 at 20 15 32
  1. Add a CSS variable to allow the header to self-declare the scroll it wants the headers to have, like here:

https://github.com/mui/material-ui/blob/fc3aee885444338ae9e4894595e2fbd509886ea7/docs/src/modules/brandingTheme.ts#L274-L276

https://github.com/mui/material-ui/blob/fc3aee885444338ae9e4894595e2fbd509886ea7/docs/src/layouts/AppHeader.tsx#L61-L68

  1. Document the above.
Motivation 🔦

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Typography component and its possible move to @mui/system, then inspect docs/src/modules/brandingTheme.ts and docs/src/layouts/AppHeader.tsx referenced in the issue. Compare the current scroll behavior with the screenshots and define how the default, header-declared CSS variable, and documentation should be covered; done means the examples scroll with the intended offset.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, react
Domain
documentation, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.