Developer forum

Forum » Swift » max-w-75ch on all text fields

max-w-75ch on all text fields

Daniel Hollmann
Reply

Hi DW:

Why is it that the class max-w-75ch is applied on all rich text fields?

This is a code example from "Swift_Text.cshtml":
 

if (!string.IsNullOrEmpty(Model.Item.GetString("Text")))
{
<div class="max-w-75ch mb-0-last-child">
@Model.Item.GetString("Text")
</div>
}
 
We are creating a site, for a customer where we use a mix of our own and standard Swift modules, and to fit the design we want to have more width on
our text fields, but it seems to be impossible to get rid of the max width, and looking at the code it seems intended.
Is this on purpose?
 

Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Yes, it is on purpose. For accessibility reasons - many people have problems reading a 50 cm long line of text. We have spend a lot of time validating things that happen on Swift on i.e. UX recommendations like Baymard: https://baymard.com/blog/line-length-readability

Also other things like WCAG, SEO, Performance, annotated markup, Loading of stuff, validation of HTML etc - all are at high levels to create a great website that comply with rules, standards and recommendations. All to convert as many visitors as possible...

You can simply overrule the css rule - check this out: https://doc.dynamicweb.com/forum/swift/swift-header-questions?PID=1605

We have it on the roadmap to make it optional - we have already learned that this is too much :-).

Votes for this answer: 1
 
Daniel Hollmann
Reply

Okay. Thanks  for your answer, and sorry I did not read the other post ;)

 
Nicolai Pedersen
Reply

No probs, and thank you for the feedback.

Also feel free to post a screendump of the text that looked wrong so we have a better understanding of the issue when we need to find a solution.

BR Nicolai

 
Daniel Hollmann
Reply

I am to create a design like this, where we have a video, and some text underneath. The video and text are supposed to be equal in width, but the max width on the text is preventing that. By removing the max-width on the text field, the text follows the row width, and everything is now fine.

2021-09-22_09h54_16.png

 

You must be logged in to post in the forum