Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
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 includeunsafe-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
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