There’s lots of apps that perform the “tidy” function… there is even a
plugin for Coda2 that will tidy (or minify) html and css and whatever.
Whether that is what you’re looking for, I don’t know.
On Thursday, February 6, 2014, RavenManiac email@hidden wrote:
Are there any applications that’ll take a jumbled mess of CCS or HTML
code and clean it up for you with proper indents and such?
CSSEdit (no longer sold) will do this for CSS. TextMate 1.5 (or 2.0 alpha, if you want to be all cutting-edge) can do this for nearly any language. There are lots of command-line tools for this, often written in Node.js, but they are all pretty neck-beard in their user interface. As the old joke goes, “Of course Unix is user-friendly – it’s just very particular about who its friends are.”
Walter
On Feb 6, 2014, at 1:05 PM, RavenManiac wrote:
Are there any applications that’ll take a jumbled mess of CCS or HTML code and clean it up for you with proper indents and such?
You can’t make a style like that (ul) in the Styles palette and then apply it to text, but anything you create in that style will apply to all lists that aren’t otherwise styled. Try this:
Make a new style with the Tag set to ul and the Name set to nothing. (Don’t forget to tab out of the name field so style23 doesn’t sneak back into there!) Set the color to red or something.
Type three lines of text, separated by returns. Select all three lines and press the List → button once to create a list.
Note that your color may or may not apply, depending on how you added it (generally, Extended stuff is invisible in the design view).
Preview in a browser. Your list items should be red.
Walter
On Feb 6, 2014, at 1:30 PM, RavenManiac wrote:
Yes, that helps. Thanks.
BTW, is it possible to create a universal unordered
or ordered list tag in FWP much, like an
,
, etc., or is that something I shouldn’t do?
The reason I ask is I need it for default CMS content, otherwise I’ll need to edit a lot of CMS templates.
Just the lack of feedback in the UI while you’re designing. These sorts of hidden defaults are great until they confuse you. I don’t know how many times I have gone down the rabbit-hole only to find that I set line-height on the body tag or something like that, and I didn’t remove it lower down the tree.
t is possible to make a Name-only style that sets the UL list behavior and sets up the defaults for all list items within it, and those you would apply by selecting a range of paragraphs and clicking the style name to apply it. That would force a list into being out of a bunch of ordinary paragraphs.
Walter
On Feb 6, 2014, at 2:33 PM, RavenManiac wrote:
Walter, that worked perfectly. Is there any reason why I wouldn’t want to set a universal ul tag?
Basically, my client is editing content through Perch using Redactor. As you know, Redactor allows the user to includes ordered and unordered lists.
Previously, I was simply editing the code from within the Perch desktop using Redactor’s code insert feature. The problem is if my client deleted the existing content, my ul and ol class tags would also be deleted.
From what I understand, I can have a universal ul tag, but not an ol tag, so my current “universal ul” solution is still a problem. What do you recommend?
You can certainly have an ol tag, just like the ul tag. They are different tags, so they will take different selectors. You can also scope the li tag to be differently styled depending on whether it is inside an ol or a ul.
html:
<ol>
<li>Thing one</li>
<li>Thing two</li>
</ol>
<ul>
<li>Thing one</li>
<li>Thing two</li>
</ul>
CSS:
ol li {
color: blue;
}
ul li {
color: green;
}
Give that a play.
Walter
On Feb 6, 2014, at 3:10 PM, RavenManiac wrote:
Hmm.
Basically, my client is editing content through Perch using Redactor. As you know, Redactor allows the user to includes ordered and unordered lists.
Previously, I was simply editing the code from within the Perch desktop using Redactor’s code insert feature. The problem is if my client deleted the existing content, my ul and ol class tags would also be deleted.
From what I understand, I can have a universal ul tag, but not an ol tag, so my current “universal ul” solution is still a problem. What do you recommend?
From what I understand, I can have a universal ul tag, but not an ol tag,
Why not?
You can use any kind of selector in the Tag field - so you can even style
everything about ul and ol lists that are common in a single group selector
Tag: ul, ol
or create a separate ul and ol style.
I prefer class styles for lists as I often use them for different things -
menus, text lists. Remember class styles are Name field styles and must be
applied to the item in FWP. Of course, I know nothing about Perch or how to
use it in FWP so maybe I won’t have anything valuable to contribute.
li tags (List Items) are both children of ol and ul tags - you can style
most text characteristics in the ol and ul tags and the li will inherit
them - except for margins or padding (eg., top and bottom). The ul and ol
elements act as containers for the li elements, and margins/padding on ul
and ol affect them as containers, and are un-inherited by the li.
Just so I’m clear, you’re manually adding a class to the ul via Redactor, correct? If so then this is a common mistake when using a CMS. You obviously discovered the problem and are moving in the right direction. In addition to using global styles you may also need to target specific elements within a CMS-controlled area which is where more specialized selectors come into play. Some of the especially useful ones (at least to me) are the numerous pseudo, adjacent and descendant selectors, among others. What this allows you to do is setup specific styles without mucking up the Redactor code with styling info the client could destroy.
Todd
Previously, I was simply editing the code from within the Perch desktop using Redactor’s code insert feature. The problem is if my client deleted the existing content, my ul and ol class tags would also be deleted.
Just so Im clear, youre manually adding a class to the ul via Redactor, correct? If so then this is a common mistake when using a CMS. You obviously discovered the problem and are moving in the right direction. In addition to using global styles you may also need to target specific elements within a CMS-controlled area which is where more specialized selectors come into play. Some of the especially useful ones (at least to me) are the numerous pseudo, adjacent and descendant selectors, among others. What this allows you to do is setup specific styles without mucking up the Redactor code with styling info the client could destroy.
Yes, that is correct. My goal was to strip all of the code out of Redactor and let FWP or Perch handle the styling. Unfortunately, I was just informed by Perch that when it comes to lists, Redactor adds its own CSS, which doesn’t make a lot of sense to me. Here’s the code Redactor added: