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

Add extensions for settings font size and line height of spans. #1990

Conversation

mjamro
Copy link

@mjamro mjamro commented Oct 7, 2021

I've added two extensions - one for setting font-size and one for line-height. They're working in the same way as extension-font-family or extension-text-align.

  {
    "type": "text",
    "marks": [
      {
        "type": "textStyle",
        "attrs": {
          "fontFamily": "Constantia",
          "fontSize": "5px",
          "lineHeight": "1"
        }
      }
    ],
    "text": "k;k;l"
}

Resolves #388, resolves #887

@mjamro mjamro force-pushed the feature/add-font-size-line-height-extensions branch from 8aec7bc to eadee7e Compare October 7, 2021 13:03
@hanspagel
Copy link
Contributor

hanspagel commented Oct 7, 2021

Thanks for the PR! I think the LineHeight should work like TextAlign and register an attribute with nodes, not with the TextStyle extension. Also docs and tests are missing.

But don’t update the PR, it’ll probably take a while until we work on that one and we can keep it from there then. ✌️

@JenuelDev
Copy link

any update on this?

@svkale
Copy link

svkale commented Jan 18, 2022

Can we just add fontSize feature for now, if it seems fine?

@danline
Copy link

danline commented Feb 1, 2022

I agree with @svkale. Can we just add fontSize for now and handle the rest in an other PR?

@jervalles
Copy link

any update? I need to change the font size on my paragraphs

@gregveres gregveres mentioned this pull request May 4, 2022
6 tasks
@gregveres
Copy link

Thanks for the PR! I think the LineHeight should work like TextAlign and register an attribute with nodes, not with the TextStyle extension. Also docs and tests are missing.

But don’t update the PR, it’ll probably take a while until we work on that one and we can keep it from there then. ✌️

I have created a gist for a line-height extension based on TextAlign as suggested. You can find it here:
https://gist.github.com/gregveres/8757756d56becc2c053c46540cb6b314

I had already created gist for font-size based on the existing font-family extension
https://gist.github.com/gregveres/64ec1d8a733feb735b7dd4c46331abae

@stale
Copy link

stale bot commented Jul 6, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 6, 2022
@stale stale bot closed this Jul 13, 2022
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.

Option for paragraph line height Font Size, Font Family, Text Color
7 participants