Flare makes awkward changes in styles.css

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Curlyshell
Propeller Head
Posts: 65
Joined: Fri Mar 01, 2019 9:14 am

Flare makes awkward changes in styles.css

Post by Curlyshell »

When I make a change to the stylesheet in Flare, it doesn't "change" the attribute in styles.css. Instead, it "appends" the stylesheet with a new entry. I just realized this, but it explains a lot!

For example, I started out with this style:

Code: Select all

	
p.DefList
	{
		font-weight: 700;
		margin-bottom: 0pt;
		mc-disable-glossary-terms: true;
		page-break-after: avoid;
	}
Then I decided to change the font-weight to 800—IN FLARE. Instead of simply changing the weight, the styles.css file did this (scroll for it):

Code: Select all

	p.DefList
	{
		font-weight: 700;
		margin-bottom: 0pt;
		mc-disable-glossary-terms: true;
		page-break-after: avoid;
	}

	span.StrongEm
	{
		font-weight: 700;
	}

	p.DefList
	{
		font-weight: 800;
	}
Note the other style in between. That's because DefList was NEAR the bottom of the print medium, but the new DefList amendment is AT the bottom. So if I'd changed a style that was further up in the document, I may never have noticed the amendment.

It explains a lot of torment. I put in a bug.

As a CSS beginner, I appreciate the easy user interface of changing styles in Flare. But we all need to get under the hood now and then. How do you work with styles? Is this a known thing? Is it new? Does it perhaps explain why my style sheet is nearly 2000 lines long?
"I'm a technical writer, not a developer," she said...
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: Flare makes awkward changes in styles.css

Post by NorthEast »

It's definitely not what normally happens, so hopefully it's just a glitch.

Unfortunately, once you've got multiple definitions of the same element in your CSS file (however they got there), then Flare isn't going to tidy them up for you.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Flare makes awkward changes in styles.css

Post by ChoccieMuffin »

Is it possible that when you changed the font you changed it in the DEFAULT medium, and the rest of it is defined in the PRINT medium? It is really easy to make changes in the DEFAULT medium when you actually want the change in a different medium. If this is the case, then Flare has done exactly as you told it to do. But I do appreciate your frustration, which is why I generally edit the stylesheet in a text editor! Best of luck, and keep asking questions.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Curlyshell
Propeller Head
Posts: 65
Joined: Fri Mar 01, 2019 9:14 am

Re: Flare makes awkward changes in styles.css

Post by Curlyshell »

Thank you both.

Unfortunately, I do keep track of which medium I'm altering. In fact, the bloat in my stylesheet includes (brace yourself) an ENTIRE duplicate @media print!

If there are contradictory definitions, Flare takes the last of them. But some of the elements are split. For example if I added a color to H1, an H1 with color alone may appear on line 1467, but the rest of the H1 attributes start on line 23. I'll need to print out all 29 pages and figure out what to cut. It's a huge mess.

Anyone else see this?
"I'm a technical writer, not a developer," she said...
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: Flare makes awkward changes in styles.css

Post by NorthEast »

It looks like if you have two @media statements with the same name in your stylesheet, Flare goes a bit crazy.

I started with this:

Code: Select all

@media print
{
	p.test
	{
		color: blue;
	}
}

@media print
{
	
}
After changing the colour of p.test a few times in the editor, it looks like Flare adds the new property instead of replacing the existing one:

Code: Select all

@media print
{

	p.test
	{
		color: blue;
	}

	p.test
	{
		color: teal;
	}

	p.test
	{
		color: orange;
	}

	p.test
	{
		color: cyan;
	}
}


@media print
{
	
}
Mention that to MadCap if they can't reproduce the bug.
Curlyshell
Propeller Head
Posts: 65
Joined: Fri Mar 01, 2019 9:14 am

Re: Flare makes awkward changes in styles.css

Post by Curlyshell »

Awesome insight, thank you!!
"I'm a technical writer, not a developer," she said...
Post Reply