overriding CSS values in the master style sheet in a build

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
yonatanlehman
Propeller Head
Posts: 51
Joined: Mon Sep 18, 2017 6:14 am

overriding CSS values in the master style sheet in a build

Post by yonatanlehman »

Hi

I like to have TBDs to my text, where in a draft build they are highlighted and in release build they are hidden
The way I do it is
1) wrap the TBD text in a span with a tbd class
2) in my main-styles css the tbd class is styled to "display:hidden", and in the draft.css they are styled to "display:inline"
3) The draft.css file is excluded (conditional text on the file) in the release build
4) In my master page I first link to main-styles.css and then to draft.css so that it will override main-styles.css

my problem
- in order for the styles in main-styles.css to show up in the styles window I need to define it as the Master Stylesheet
Flare then includes this file (again) AFTER the <header> in my master sheet along with all its other stuff - so I have main-styles.css included twice (bad...) and the draft.css doesn't override the main-styles (very very bad......) because it comes before the second link.


So how do I achieve
1) Show styles from main-styles.css in the styles window
2) override the styles in main-styles.cc with css in draft.css only on certain types of builds

To make matter worse - I can't change main-styles.cc - its a file I get "as is" from the main website so I can't adapt it (i.e. import draft.css from there)

Any ideas ?
Thanks
yonatanlehman
Propeller Head
Posts: 51
Joined: Mon Sep 18, 2017 6:14 am

Re: overriding CSS values in the master style sheet in a bui

Post by yonatanlehman »

Answering my own question

1) create a master stylesheet master.css, set this as the master in the project or both the release and the draft targets
2) In that stylesheet link to the main-style.css and to the draft.css files - I prefer to do this in the text editor since the order is important
@import url('main-style.css')
@import url('draft.css')
3) Create a "draft" tag under conditional text, set this flag for the draft.css flag, and include it in the draft target, exclude it in the release build

Hope that it makes sense - I was a bit telegraphic.....
Post Reply