Defining a "style-after" style
-
todd.richardson
- Sr. Propeller Head
- Posts: 187
- Joined: Thu Aug 07, 2008 6:43 am
- Location: Massachusetts
Defining a "style-after" style
I would like to specify a particular style to always be used after another style (for example, a p.body style under a h1 style). How is this done in Flare? I can't seem to find the appropriate property in the stylesheet.
Thanks.
Thanks.
Todd Richardson
Engineering Team Lead – Customer Experience | IntervalZero
Windows 10, Flare 2020
Engineering Team Lead – Customer Experience | IntervalZero
Windows 10, Flare 2020
Re: Defining a "style-after" style
There is no such functionality. At least, not that I'm aware of. You can create a complex selector that controls how a <p> tag that immediately follows an <h1> tag appears, but you can't specify that the <h1> tag is always followed by a <p> tag or class thereof.
Of course, when you create a new topic, the heading style you select (h1 by default) in the Add Topic screen is always followed by a simple <p> tag when the topic is created. So if there's no real requirement for you to use p.body instead of p, then I'd stick to the base <p> tag. Is there a particular reason why you need to use p.body?
Of course, when you create a new topic, the heading style you select (h1 by default) in the Add Topic screen is always followed by a simple <p> tag when the topic is created. So if there's no real requirement for you to use p.body instead of p, then I'd stick to the base <p> tag. Is there a particular reason why you need to use p.body?
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: Defining a "style-after" style
Yes, a complex selector does exist for style after style. I use it in my tables.
The syntax is <preceding_element> + <proceeding_element>
So if I wanted to create a different style for any p tag that was preceded by an h1 tag, here is the code:
This would mean any p tag that comes after an h1 tag has a zero-pixel margin at the top.
See this resource for more information on complex selectors.
The syntax is <preceding_element> + <proceeding_element>
So if I wanted to create a different style for any p tag that was preceded by an h1 tag, here is the code:
Code: Select all
h1 + p
{
margin-top: 0px;
}See this resource for more information on complex selectors.
Flare v6.1 | Capture 4.0.0
Re: Defining a "style-after" style
That's the complex selector I was talking about, but that doesn't mean that the <h1> tag is automatically followed by a <p>, or in his example <p class="body">. You still have to manually add the paragraph tag after the <h1> tag (although most programs, including Flare, automatically do that) and then apply the "body" class to the paragraph tag.
You could have multiple complex selectors like h1 + p, h1 + div, h1 + p.note, and so on, but so far as I know, there's no way to specify what tag is automatically inserted into the topic following the h1 tag.
You could have multiple complex selectors like h1 + p, h1 + div, h1 + p.note, and so on, but so far as I know, there's no way to specify what tag is automatically inserted into the topic following the h1 tag.
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: Defining a "style-after" style
Ah, I see. I misunderstood the original post. I should have known there was a reason you hadn't mentioned the complex selector.
Yep, definitely don't know a way to specify a "next tag."
My best stab at a solution would be that, if you know two (or more) tags always go together in order, you could create a snippet of them, and insert that and convert to text instead of changing the style...but honestly, inserting snippets is probably more trouble than changing the style manually.
My best stab at a solution would be that, if you know two (or more) tags always go together in order, you could create a snippet of them, and insert that and convert to text instead of changing the style...but honestly, inserting snippets is probably more trouble than changing the style manually.
Flare v6.1 | Capture 4.0.0
-
doc_guy
- Propellus Maximus
- Posts: 1979
- Joined: Tue Nov 28, 2006 11:18 am
- Location: Crossroads of the West
- Contact:
Re: Defining a "style-after" style
Sorry to but in and threadjack, but can I officially recommend that you don't use a "body" class for <p>?
People who migrate from Frame often want a "body" element, so they throw a "body" class onto the <p> element which is totally unnecessary and creates a huge hassle for yourself and sets up the possibility of confusion and non-parallel paragraphs down the road.
The body tag in Frame is equivalent to the <p> element in Flare is equivalent to the normal style in Word. (Which isn't proper grammar, but it is kind of like a mathematical equation.)
For the default paragraph style, use <p>. If you need special classes of <p>, go ahead and create them. But for all the love of Flare, do yourself a favor and don't use a body class for <p>.
<breath>
Alrighty now. I fell better getting that off my chest...
People who migrate from Frame often want a "body" element, so they throw a "body" class onto the <p> element which is totally unnecessary and creates a huge hassle for yourself and sets up the possibility of confusion and non-parallel paragraphs down the road.
The body tag in Frame is equivalent to the <p> element in Flare is equivalent to the normal style in Word. (Which isn't proper grammar, but it is kind of like a mathematical equation.)
For the default paragraph style, use <p>. If you need special classes of <p>, go ahead and create them. But for all the love of Flare, do yourself a favor and don't use a body class for <p>.
<breath>
Alrighty now. I fell better getting that off my chest...
Re: Defining a "style-after" style
I submitted a request for this awhile ago. The more people that submit, the better chance that it will come!
Mike
-
doc_guy
- Propellus Maximus
- Posts: 1979
- Joined: Tue Nov 28, 2006 11:18 am
- Location: Crossroads of the West
- Contact:
Re: Defining a "style-after" style
Seems like a tricky implementation. I mean, you'd have to do it in the style sheet, which isn't really equipped for this type of thing, because the style sheet would need to be aware of all the other possible styles that you've created. In the Flare interface, yeah they can do this. but it isn't going to be valid CSS (though lots of Flare-specific stuff isn't valid CSS, so what is one more thing?)....
It' would be cool.
Though, now I think about it, I bet that this could really take shape with the forthcoming DITA support. Essentially, what you are doing is creating a structure that you want to enforce, which is the whole point of structured authoring, which DITA is.
Hmmm... something to think about.
It' would be cool.
Though, now I think about it, I bet that this could really take shape with the forthcoming DITA support. Essentially, what you are doing is creating a structure that you want to enforce, which is the whole point of structured authoring, which DITA is.
Hmmm... something to think about.
-
todd.richardson
- Sr. Propeller Head
- Posts: 187
- Joined: Thu Aug 07, 2008 6:43 am
- Location: Massachusetts
Re: Defining a "style-after" style
Thanks, everyone, for your input on this.
Paul -
The p.body style I used in my example was simply that - an example.
Paul -
The p.body style I used in my example was simply that - an example.
Todd Richardson
Engineering Team Lead – Customer Experience | IntervalZero
Windows 10, Flare 2020
Engineering Team Lead – Customer Experience | IntervalZero
Windows 10, Flare 2020
-
doc_guy
- Propellus Maximus
- Posts: 1979
- Joined: Tue Nov 28, 2006 11:18 am
- Location: Crossroads of the West
- Contact:
Re: Defining a "style-after" style
Oh good. I'm glad.
Sorry to rant. I think it was kind of late in the day on Friday....
Sorry to rant. I think it was kind of late in the day on Friday....
Re: Defining a "style-after" style
You can define this behaviour for the Flare editor in the stylesheet, using the properties mc-next-tag and mc-next-class, e.g.:todd.richardson wrote:I would like to specify a particular style to always be used after another style (for example, a p.body style under a h1 style). How is this done in Flare? I can't seem to find the appropriate property in the stylesheet.
Code: Select all
h1
{
mc-next-tag: p;
mc-next-class: body;
}These properties don't show up in the stylesheet editor, so you need to open the stylesheet in text view to add them.
One thing I haven't worked out how to do is to reset the class, e.g. if you had a style p.note, I don't know how to use the mc-next-class property to set the next line to just p (with no class).
-
todd.richardson
- Sr. Propeller Head
- Posts: 187
- Joined: Thu Aug 07, 2008 6:43 am
- Location: Massachusetts
Re: Defining a "style-after" style
Excellent - thank you.
Todd Richardson
Engineering Team Lead – Customer Experience | IntervalZero
Windows 10, Flare 2020
Engineering Team Lead – Customer Experience | IntervalZero
Windows 10, Flare 2020
Re: Defining a "style-after" style
Oooh, when did they add that?Dave Lee wrote:You can define this behaviour for the Flare editor in the stylesheet, using the properties mc-next-tag and mc-next-class...
To use your example, Dave, couldn't you use the following:
Code: Select all
p.note
{
mc-next-tag: p;
}Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
-
todd.richardson
- Sr. Propeller Head
- Posts: 187
- Joined: Thu Aug 07, 2008 6:43 am
- Location: Massachusetts
Re: Defining a "style-after" style
I didn't see these values in the stylesheet, so I added them to the style through the text editor. Works great.
Todd Richardson
Engineering Team Lead – Customer Experience | IntervalZero
Windows 10, Flare 2020
Engineering Team Lead – Customer Experience | IntervalZero
Windows 10, Flare 2020
Re: Defining a "style-after" style
I don't have Flare open at the moment, but they most likely appeared under the "Unclassified" group when the view is set to "Show: Property Groups" and you're in Advanced view.
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
-
SteveS
- Senior Propellus Maximus
- Posts: 2090
- Joined: Tue Mar 07, 2006 5:06 pm
- Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
- Contact:
Re: Defining a "style-after" style
Create a class p.after_head and set its mc-next-class property?Dave Lee wrote: One thing I haven't worked out how to do is to reset the class, e.g. if you had a style p.note, I don't know how to use the mc-next-class property to set the next line to just p (with no class).
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
Re: Defining a "style-after" style
They don't appear in Flare 4 (not sure about 4.1...don't have that installed at work yet).LTinker68 wrote:I don't have Flare open at the moment, but they most likely appeared under the "Unclassified" group when the view is set to "Show: Property Groups" and you're in Advanced view.
Flare v6.1 | Capture 4.0.0
Re: Defining a "style-after" style
They don't appear in 4.1.40 either. Alright, Dave Lee, spill... Where did you find those properties?Andrew wrote:They don't appear in Flare 4 (not sure about 4.1...don't have that installed at work yet).LTinker68 wrote:I don't have Flare open at the moment, but they most likely appeared under the "Unclassified" group when the view is set to "Show: Property Groups" and you're in Advanced view.
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: Defining a "style-after" style
Here, here...LTinker68 wrote:They don't appear in 4.1.40 either. Alright, Dave Lee, spill... Where did you find those properties?
http://forums.madcapsoftware.com/viewto ... 64&p=33583
Nope, it doesn't reset the class if you have the same tag, e.g. if your p.note style just had mc-next-tag: p set and noLTinker68 wrote:If there's no class specified then it seems like it would default back to the base (parent) tag.
mc-next-class, the next line would be a p.note too. Setting the mc-next-class to something like none (or anything else I tried) just gave me a style p.none.
Re: Defining a "style-after" style
Ok, then, Dan G... Same question.Dave Lee wrote:Here, here...LTinker68 wrote:They don't appear in 4.1.40 either. Alright, Dave Lee, spill... Where did you find those properties?
http://forums.madcapsoftware.com/viewto ... 64&p=33583
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: Defining a "style-after" style
Is it possible that Dave Lee, opened the Flare schemas and scanned it through to discover this super secret super powerful tip? 
anyway this is coming in very useful to me now. this has got to be, for me, one of those hard to find, super good undocumented super top secret things, that not even the support team knows.
anyway this is coming in very useful to me now. this has got to be, for me, one of those hard to find, super good undocumented super top secret things, that not even the support team knows.
If you submit your bug feedback request here, the more likely it'll get fixed or included in a future release
Open Utilities PageLayout Resizer for Flare/Blaze | Batch builder
Open Utilities PageLayout Resizer for Flare/Blaze | Batch builder
Re: Defining a "style-after" style
forfear wrote:Is it possible that Dave Lee, opened the Flare schemas and scanned it through to discover this super secret super powerful tip? :)
No, just got a good memory - it was dang that originally posted the tip.
Re: Defining a "style-after" style
I really must find some way to make this topic sticky or a favourites...3rd time on i had to search the forums for this one tip. 
If you submit your bug feedback request here, the more likely it'll get fixed or included in a future release
Open Utilities PageLayout Resizer for Flare/Blaze | Batch builder
Open Utilities PageLayout Resizer for Flare/Blaze | Batch builder
Re: Defining a "style-after" style
There's a 'Bookmark topic' link at the bottom of the page - it's easy to miss!forfear wrote:I really must find some way to make this topic sticky or a favourites...3rd time on i had to search the forums for this one tip. :)
