-
Notifications
You must be signed in to change notification settings - Fork 672
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
'Text' component to use 'p' or span as default #1250
Comments
We have the |
Changing it to a default |
Yep, definitely a breaking change. Also if you're styling children via selectors etc. Would make more semantic HTML by default though. |
I think it would be correct for Text to have been a |
Nonetheless, span is inline by default while p is block by default, so definitely still a breaking change |
We may be able to default the margins / spacings to be the same as div - maybe making it a span so that it is inline by default. |
I dont know if we should introduce a breaking change, but if we do, i vote for |
Might be just me, but I almost always use Both the breaking-change and having another "Paragraph" component defaulting to a "p" sound good to me |
@flo-sch - would you want to contribute a |
@flo-sch @atanasster do we need a Paragraph component? I mean, would it be different to |
@hasparus i think we need a Paragraph - it will have its own theme key. |
Interesting. Yeah, I very occasionally use Text inline but it's almost always a paragraph, & I sometimes forget to include the |
I am just afraid we can run into really hard to catch breaking changes with changing Text to a p.
what do you guys think? |
I am not actually 100% sure, since today, I missed the fact that Box sets a margin, which in our case might invalidate the issue of the default margin applied to an HTML Then if we add a new Paragraph component, it would mainly bring a new themeKey for texts (which indeed does not seem to add a lot of value, since we can already define variants inside |
I have nothing against a new component neither per say, I would personally be more tempted to look for a (However I would personally find |
Okay, I don't see another solution to this. https://www.strawpoll.me/33187129 I'm biased towards no-paragraph & Text as span, because that's how Braid does it, but I don't care strongly about it. cc @dcastil |
@hasparus - that polling is great !!! Can you please add also Also not feeling too strong about it. |
The poll options are immutable already. |
np - i voted for adding Paragraph and change to span then :) |
If we are not defaulting the I think with a codemod and a breaking change we could do this. The codemod could find every usecase of @flo-sch you mention "However I would personally find span as default for to be a rather annoying BC" - what would be annoying about that for you? (Not attacking just curious in case I have missed something) |
|
We have some results, but very tight :)
|
100% agree with that,
The I almost always use Anyway, I am clearly in favor of a styled component defaulting to |
We agree that the |
@hasparus - excellent decision, in a close call I also always leave it to the person doing the work(PR) :) Any takers for this feature? I will have some free time in a day or two if no one jumps in. |
I can take that, sounds doable for me :) |
FWIW |
It's so annoying to auto-import it because of this -.- That's a point in favor of Paragraph. |
The components in master branch are still written in JS though (not TS), is it better if I base my PR on a different branch, or work on those? |
@atanasster @flo-sch the components on master are official. Just update that |
Completely missed the |
Have just picked this library up on a project, and so far so good. Except I worry about the fact that the default HTML element that is used for the
<Text>
primitive is adiv
- would there be pushback for me to PR to swap this to ap
orspan
and add anas
prop to change the base renderer?The text was updated successfully, but these errors were encountered: