Using ProjectDictionaryOverrides.css uniquely for each configuration

25 views
Skip to first unread message

Jeff Heath

unread,
Jun 25, 2024, 2:54:51 AMJun 25
to FLEx list
This is a continuation of the question posed on this thread: https://groups.google.com/g/flex-list/c/7QGg2TACo2E/m/HsokHzIuAQAJ:

"Can you define CSS rules in the Overrides file that only apply to certain configurations? If we are adding rules for an app layout, we don't want to mess up other layouts!"

It seems like I had some discussions about this before, but can't find any trace of them now. I guess you could have several ProjectDictionaryOverrides.css files in your project folder (one for each relevant configuration)  and rename the one you want to ProjectDictionaryOverrides.css before using it. But that is a fairly painful process... The problem in that other thread was that there was a style definition in the override that was affecting a different configuration, and I thought I was starting with a fresh configuration.

Thanks for any insights on this issue.
Jeff

Beth-docs Bryson

unread,
Jun 25, 2024, 12:26:45 PMJun 25
to flex...@googlegroups.com
Jeff, one thing to keep in mind is that Styles are stored in a different place than configurations, and they work independently.  That is, Styles are stored in a central location and are used by ALL configs.

So if you have two different configurations that want to use a style that has the same name, however that style is defined, will apply to both configurations.

On the other hand, if you make two different styles (slightly different names, different specs), then you can use one of those in one config, and the other in the other config, and that’s how you can separate them.

A little muddled, but hopefully it gives an idea.

-Beth

--
"FLEx list" messages are public. Only members can post.
flex_d...@sil.org
http://groups.google.com/group/flex-list.
---
You received this message because you are subscribed to the Google Groups "FLEx list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flex-list+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flex-list/f57790f1-57f4-4903-b0ea-0d7624e012d3n%40googlegroups.com.

Jeff Heath

unread,
Jun 25, 2024, 4:24:31 PMJun 25
to FLEx list
Thanks for the feedback, Beth, but I'm a little confused. The file ProjectDictionaryOverrides.css has CSS rules to provide style overrides which can't be done in the normal style settings, correct? So this question doesn't really have anything to do with the style definitions in FLEx, and trying to separate them in different configurations. The basic problem is that ProjectDictionaryOverrides.css seems to apply to all configurations, but if I have a configuration created to produce a dictionary app, it might require very different CSS rules than a configuration for a print publication (which may need no special CSS rules). Or I might have a FLEx database that has the vernacular in both Roman and Arabic scripts, with two different app configurations (one RS and one AS) with very different requirements for the Overrides.css file. (This is a real situation, and the main reason I'm asking this question.) The only way I can think of to handle that problem is to create separate ProjectDictionaryOverrides-RS.css and ProjectDictionaryOverrides-AS.css files in the project directory, and rename one of them to ProjectDictionaryOverrides.css when you want to use that particular configuration. Pretty ugly...

Jeff

jason_...@sil.org

unread,
Jun 25, 2024, 6:54:57 PMJun 25
to FLEx list

I don't think there is currently a better way to do this than the renaming option you described.

In specific situations it might be possible to define the rules to only apply to content in one configuration. For instance the css rules can be quite specific using the available attributes, including 'lang', but that may not always be sufficient.

We didn't consider a multiple configuration use case when we introduced the ProjectDictionaryOverrides.css feature.
Since you have a real world need for this we can consider it as a feature in the future.  It's nice to know that the advanced feature is getting use, even if you would like it to be more advanced. :-)

Jason

Jeff Heath

unread,
Jun 26, 2024, 4:13:17 AMJun 26
to FLEx list
Thanks for the feedback, Jason. We'll use the renaming option for now.

I'd like to suggest an "easy" way to implement this feature... :-)  At the top of the Configure Dictionary dialog, you select the view to configure:
FLEx configure dictionary.png
You could add a button between the view drop-down menu and the "Manage Views..." button called "CSS Overrides". (Logically it might make more sense to put the button beneath the view drop-down menu, but I'd hate to take screen real estate away from the long list of content elements below.) When you click this button, it presents a simple text entry dialog where the CSS rules for that view configuration can be entered/edited. FLEx would save these CSS overrides in a way that they would only be applied to the presentation of that configuration. (And when data is exported to XHTML, the appropriate CSS would be sure to be attached.) The "CSS Overrides" button could be in a small font, or just a simple "CSS" icon, to make it less conspicuous. It looks like all of the view configurations are stored in the same folder as the Overrides.css:
    C:\ProgramData\SIL\FieldWorks\Projects\(projectname)\ConfigurationSettings\Dictionary
So the CSS overrides could just be saved with the configuration name (like the .fwdictconfig files) but with an extension of .css.

Anyway, I'm not pushing, but since I had the idea of how I might implement it myself, I thought I would share it with you. :-)
Jeff
Reply all
Reply to author
Forward
0 new messages