Skip to main content
Inspiring
February 21, 2013
Question

Multiple CSS files in a project

  • February 21, 2013
  • 4 replies
  • 3205 views

RH9 | WebHelp

Does anyone know if it's possible to include more than one CSS file in a project? For ease of maintenance, I'd like to split my default.css into individual files, for example, a main.css (which has @imports and is referenced in my topics), a typography.css, a structure.css, a lightbox.css, etc, etc. I've had a play around with this and it appears to work, however, when I try to close my project RoboHelp gets upset and freezes.

Thanks

Jonathan

This topic has been closed for replies.

4 replies

Community Expert
December 1, 2021

Also note that multiple stylesheets are supported in RH2019 and above so you can just apply multiple stylesheets to your topics.

Known Participant
December 7, 2021

Yes, you are able to add these manually once the topic has been created but there is no way of adding references to multiple css files in the settings. So when a editor creates a new topic only one css file will be referenced.

I want to be able to have references to multiple css files on the fly when a new topic is created. I've tried to use the @1552174 solution but that does not work either.

Peter Grainge
Community Expert
Community Expert
December 7, 2021

Yes new topics will only have one CSS but it's easy enough to add more here.

 

 

Effectively what you want is a customised default template. That would need a feature request. Please follow this link to report bugs or request new features. https://tracker.adobe.com. Post the link to your bug report / feature request in this thread and others can vote for it. The more people who do so, the higher it gets prioritised.

 

Alternatively, create such a topic and get the authors to create a copy of it each time they want a new topic.

________________________________________________________
See www.grainge.org for free Authoring and RoboHelp Information

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
Peter Grainge
Community Expert
Community Expert
December 1, 2021

@a_David This is a very old thread and any information would relate to a much older version of RoboHelp. See if this helps. Using Font Awesome, Google Fonts, @font-face and SVGs in RoboHelp (grainge.org)

 

If nothing is showing in the Styles panel, that is a sign that CSS cannot be parsed. Maybe it contains some @media styles? If so, comment them out. It could simply be something you have added in your efforts to get this working. 

________________________________________________________
See www.grainge.org for free Authoring and RoboHelp Information

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
Known Participant
December 7, 2021

To me everything is done as it should. I've tried with a simple test case.

 

I've got two CSS files. "core.css" and "headings.css". "core" is referenced in the topic.

In "core" there's only the import rule (@import url("headings.css");)
In "headings" I've got one style added for the h1 tag. This style has color red to it.

Now in RH the h1-tag becomes red so the style is working but the format will not show up in the style selection list.

Known Participant
December 1, 2021

Been a while since you posted this but I'm currious how you got the @1552174 working. I'm using RH 2020 but have no luck using @1552174, the imported CSS files are not beeing recognized by the WYSIWYG editor and no styles are available.

RoboColum_n_
Legend
February 21, 2013

Hi Jonathan. It is possible to have two or more CSS files in a project. So that in inself should not cause your project to freeze. There must be something else that is the issue here. Can you tell us what you mean when you say you are "splitting" the default.css file?

Jop_SmithAuthor
Inspiring
February 21, 2013

Hiya

Basically, my default.css is getting pretty big because I have styles for things like a slider and a lightbox in there. What I thought I could do is create separate stylesheets for each element (e.g. type, structure, slider, lightbox, etc) like you would do when building a website, and then reference them all in each of my topics like this:

<link rel="StyleSheet" href="typography.css" type="text/css" />

<link rel="StyleSheet" href="structure.css" type="text/css" />

<link rel="StyleSheet" href="slider.css" type="text/css" />

<link rel="StyleSheet" href="lightbox.css" type="text/css" />

A neater solution would be to reference a single stylesheet in each of my topics, say main.css, that imports the separate CSS files:

<link rel="StyleSheet" href="main.css" type="text/css" /> which contains:

@import url("typography.css");

@import url("structure.css");

@import url("slider.css");

@import url("lightbox.css");

I've tried both methods and RoboHelp freezes when I try to close my project.

Jeff_Coatsworth
Community Expert
Community Expert
February 21, 2013

have you tried this (this master/sub css approach) with the sample projects? have you tried the (just one css) approach with your project? does it choke too? maybe it's something in your project that causing a choke to occur