Open karlbaumhauer opened 9 months ago
I believe that we will implement lists etc. as styles, too. Therefore this should be a style. As we already discussed introducing a sd-prose
class (like TailwindCSS does es described here https://tailwindcss.com/docs/typography-plugin and shown e. g. here https://play.tailwindcss.com/uj1vGACRJA?layout=preview), this could be a great place to do this.
Only thing which would have to be considered is implement basic a
styles, as this is currently only handled in sd-link
or sd-interactive
.
Hi:) Comment from my side as we are/will be using ui-richtext on different places: components we get/need transformation are: <h>, <a> , <p>
and lists <ul>/<ol>.
Sometimes ofcourse we get ui-link/sd-link because of icon info. Possibility to pass font size and text color would be appreciated (as richtext would be good fit for footnotes for example). There is also possibility of passing an anchor element to richtext (probably as component because of shadow doms).
I believe that we will implement lists etc. as styles, too. Therefore this should be a style. As we already discussed introducing a
sd-prose
class (like TailwindCSS does es described here https://tailwindcss.com/docs/typography-plugin and shown e. g. here https://play.tailwindcss.com/uj1vGACRJA?layout=preview), this could be a great place to do this.
So we would have the following (previously components in the CL and used here for transformation):
Is this correct?
Isn't the paragraph already covered in the sd-display
?
Only thing which would have to be considered is implement basic
a
styles, as this is currently only handled insd-link
orsd-interactive
.
If we add the link as styles as well, couldn't this then be used in the sd-link
and sd-interactive
? Or was this your plan?
In general I still see kind of a need for a component that transforms / adds the style classes to the native HTML elements coming from a WYSYWIG editor. Or would you like the users to add the classes globally to their project?
Topic is aligned with brand
sd-prose style based on https://tailwindcss.com/docs/typography-plugin like suggested No buttons No links Prevent text wrapping around images
Migration guide: Use CMS-text-image-video (maybe rename to e.g. CMS-text-media)
How do we handle the HTML tags?
for example: if you use an anchor -> <a href="#"></a>
this should automatically changed to sd-link.
Yah, so a
will get the styles of sd-link (without the icon stuff). Some for the headlines: They will be h2
but will have the style of lg
or whatever.
Yah, so
a
will get the styles of sd-link (without the icon stuff). Some for the headlines: They will beh2
but will have the style oflg
or whatever.
@mariohamann we discussed that last week and agreed on moving this responsibility to the users in case of interactive components => see description.
So <h2>
will get sd-headline--lg
class but <a>
needs to be replaced in a translation-helper in the implementation code.
If you don't see any (further) major issues, pls move the issue to "refinement".
I see this a big issue.
Currently the ui-richtext
component is exactly this transformer:
I understand the last concept of people needing to set the classes as expected:
Example:
<div class="sd-prose">
<h1 class="sd-headline sd-headline--level-1">Headline</h1>
<p class="sd-paragraph">Blabla</p>
</div>
Here sd-prose
would just bheave as a "spacing" helper, to set the correct margins.
The idea of a prose
or richtext
style has the concept of NOT needing to set additional classes or changing the tags but instead take only the semantics to style things.
Example:
<div class="sd-prose">
<h1>Headline</h1>
<p>Blabla</p>
</div>
Here sd-prose
would do the magic.
The first would IMO offload too much or actually wouldn't be a big replacement but really just a thing for spacings. The latter would be a more or less drop-in replacement. Of course the latter takes more time, too – but might be more what people aim for.
I see this a big issue.
What this reads like
Currently the
ui-richtext
component is exactly this transformer:I understand the last concept of people needing to set the classes as expected:
Example:
<div class="sd-prose"> <h1 class="sd-headline sd-headline--level-1">Headline</h1> <p class="sd-paragraph">Blabla</p> </div>
Here
sd-prose
would just bheave as a "spacing" helper, to set the correct margins.
I think there is a misunderstanding. The sd-prose should be taking care of everything. So inside the sd-prose, we cover all styles with/from our style-components (headline, paragraph, list, meta etc).
My understanding
The idea of a
prose
orrichtext
style has the concept of NOT needing to set additional classes or changing the tags but instead take only the semantics to style things.Example:
<div class="sd-prose"> <h1>Headline</h1> <p>Blabla</p> </div>
Here
sd-prose
would do the magic.
This is exactly what I would expect from sd-prose
.
The only thing as a change to the ui-richtext
is the transformation of HTML elements. I would leave this to the users as the link and the interactive would be the only components which need JS-Magic. If we leave this to the users, we can cover all with a style-component (not nice but helps us a lot).
@mariohamann If you agree to this and like, pls rewrite the ticket accordingly.
Lets talk about that in our pre-refinement on friday.
Lets talk about that in our pre-refinement on friday.
As I will not be there on Friday: I strongly vote for an no-JS-solution and just provide a pattern in addition on how to implement the transformation-JS-stuff.
If we are possible to just provide a sd-prose
style, we would cover a bunch of requirements with a very lightweight style component.
@EllaELSA I would like to talk to you about spacing requirement, pairings used often, etc. ... Let’s have a session on that
I'm done with refining @karlbaumhauer @yoezlem @coraliefeil
thx @mariohamann
I still have 2 questions:
<a>
tag look like an sd-link
. If we leave the transformation to the project teams, shouldnt we also exclude the link and all interactive elemtns out of the prose? Then, the users see that they forgot something and dont just leave it looking like a link but not behave like one.Ready for review / approval Figma Branch
Ella gave her go ... issue can be pre-refined on Friday.
Draft PR from Mario: https://github.com/solid-design-system/solid/pull/930
@mariohamann is the only missing thing in your draft the documentation? Since we are a bit under time pressure, could you take on the ticket and finish it up?
No. There's more missing and I really wrote it more like "this is how it works". If no one feels comfortable with it, of course I could take over.
It is not that no one of the devs feel comfortable with it. Both of them are full with other Tickets. So I thought we could maybe solve this one faster with you.
Thx @mariohamann!
User Story
As a user of the Solid Design System, I would like to have a component, which formats default HTML elements like
a
,ul
etc. without adding further classes on those elements, so that data from e. g. CKEditor or similar can be used without much processing. In addition spacing rules will be incorporated.Documentation / Hand-off
Figma Branch
Example
Here all spacings between elements etc. would be fine and in addition the
ul
would look likesd-list sd-list--unordered
anda
likesd-link
etc.Technical Information
Full Prose CSS
ui-richtext
will be completely replaced. Missing elements or special cases have to be incorporated in the project, e. g. columns.This should be done by adapting the current styles, to make them work with
.sd-prose
, like e. g. shown here: https://github.com/solid-design-system/solid/pull/930/files#diff-c66aa3dc3413a1fe584db126911a3a3eb72f791486e81a0e2094b42c0b0cffbbComponents detailed requirements
Like in Figma displayed, these are some more details about the requirements for the
sd-prose
:<hr>
- horizontal rule ->sd-divider
<h1>
to<h5>
<blockquote>
quotation-marks<table>
-> standard table formatting<figcaption>
in sd-media using additional text color (text.neutral-700)Stories
default
- "Kitchen Sink" => shows all features in one storyInverted
- shows the default story in inverted modeSamples
Subtasks
DoR
DoD