Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Yesterday 13:26:38

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,125
Website GitHub Mastodon Twitter

textile text alignments

At the moment, and since the beginning textile translated text alignments such as p>. with inline css. ie <p style="text-align:right;">...</p>. I think that conflicts with the separation of content from style.

I was wondering if it is prudent to change that to a class such as <p class="align-right;">...</p>, and what would the problems be if an additional class is required by the author such as p(my-class)>.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 Yesterday 19:59:39

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 312
Website GitHub GitLab Mastodon Twitter

Re: textile text alignments

I think <p align="right">…</p> would break style from content separation principle, not <p style="text-align:right">…</p>. Witch requires a corresponding item in an external style sheet or in a header of the webpage. Not always desirable. And also, the class should be named semantically, not visually. Anyway, you can always mark p(spec-style). instead of p>..

Offline

#3 Yesterday 22:58:25

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,773
Website

Re: textile text alignments

Yeah, it is a bit of a conundrum. Specifying p>. Text ranged right is, I guess, the author already adding styling to the content, so concerns are getting mixed. Each of the options has their pros and cons:

  • <p style="text-align: right;">Text ranged right</p> works in all browsers, but not if you set the CSP rules for your site and do not include unsafe-inline among your directives.
  • <p align="right">Text ranged right</p> might survive CSP (?) in that it is not open to misuse/abuse for other purposes, but as far as I can tell that attribute is deprecated from HTML, so its days seem numbered.
  • <p class="text-right">Text ranged right</p> would be safest but requires that your css styles include a correspondingly named helper class (e.g. as per tailwind). Without it, you do not get the desired result.

For now, if you want to be safe, Vienuolis’s suggestion of deliberately specifying a class name and then including that in your style would seem to be most future-proof.


TXP Builders – finely-crafted code, design and txp

Offline

#4 Yesterday 23:53:43

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,269
Website

Re: textile text alignments

I can’t remember ever using those Textile alignment markers, personally.

Having a class in your stylesheet specifically for that purpose is rather evident and part of basic building blocks of your layout.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB