question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[RFC] Renaming Joy APIs

See original GitHub issue

This RFC list several points related to renaming Joy UI APIs so that we can discussed before making the changes.

  1. ~Rename color prop to palette~ Decided to go with textColor prop instead, details here:

    <Link color="primary" textColor="#000">
    
  2. ✅ Rename variant values: The reason to rename the values is to set apart from these existing names (CSS properties, color modes) and make them meaningful as much as possible. https://github.com/mui/material-ui/pull/32489

    These are other names that we can consider.

    • bordered (but it is too close to CSS property border)
    • ghost (similar to Chakra UI)
    • filled, subtle (from Mantine)
  3. ~Rename primary palette to brand: continue from https://github.com/mui/material-ui/pull/31090#issuecomment-1047435912 to gather more thoughts. ~

  4. Add/Remove typography scale: After doing POC with several apps, it becomes clear that the current h1 and h2 are too big and I have never used h5, h6 (as an HTML tag). I have to always do this <Typography level="h2" fontSize="lg" />. It makes more sense to have display1, 2 for the headline like in MUI branding.

    • ✅ add display1 and display2
    • ~remove h5 and h6~

    From tailwind CSS https://play.tailwindcss.com/uj1vGACRJA?layout=preview We haven’t used an h4 yet But now we have. Please don’t use h5 or h6 in your content, Medium only supports two heading levels for a reason, you animals. I honestly considered using a before pseudo-element to scream at you if you use an h5 or h6.

We don’t style them at all out of the box because h4 elements are already so small that they are the same size as the body copy. What are we supposed to do with an h5, make it smaller than the body copy? No thanks.

  1. ~Rename level prop on the typography component to scale for consistency with the system: level was initially added in Joy to replace the variant (because Joy’s variant is different). Some discussion is in https://www.notion.so/mui-org/MUI-System-890bb3d81cbf45008fd5d2f90f53539d#5de65bde31ec4a84931cd62081d27e04~

If you think other APIs need to be renamed, feel free to add it to the list. Not every bullets have to be decided in this RFC, we can start working on the first batch and revisit the rest later.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
mnajdovacommented, Apr 21, 2022
  1. Rename color prop to palette

I am not sure only on this one. I think the problem is not with the color prop itself, but how we use the same term for different things. In my opinion, we should keep the API close to how you would describe the UI if you see it. For example if I see a button with blue background I would say that the button has a blue color, not that it uses the blue palette. The problem is with the CSS properties that we use on some of the components as props. If I go one step further, I would say that the css prop color is a bad chosen name (I am being wild here 😄), it should be something like textColor, similar to backgroundColor. My proposal would be renaming the CSS prop we use on the components from color to textColor. This way people won’t confus this with the color prop that exists on other components (or on the same component as in the case of the Link component).

1reaction
danilo-lealcommented, Apr 15, 2022

I’d say that using outlined, in the past tense, is enough to avoid confusion with CSS’s outline. It’s widely used and following convention here seems like a safe thing to do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

17.7.0 API Reference - joi.dev
If a key is renamed and then its value fails to pass a validation rule, the error message will use the renamed key,...
Read more >
draft-ietf-ldapext-ldap-java-api-19 - IETF Datatracker
JAVA LDAP API April 2004 in this document are to be interpreted as defined in "Key words for use in RFCs to Indicate...
Read more >
RFC 2614: An API for Service Location
This document describes standardized APIs for SLP in C and Java. ... Service types with the IANA naming authority are registered with the...
Read more >
[RFC PATCH 0/8] IO throttling - Google Groups
This adds the set_rate_limit API call for the priority class that ... Renames an `io_priority_class` previously created with ... It's still RFC.
Read more >
[RFC 00/10] add support for fwnode in i2c mux system and sfp - kernel
A solution for this is to use the fwnode API which works with both device-tree, ACPI and software node. In this series, functions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found