Hi,
I have a stylesheet that I want to apply to a project that has another stylesheet currently applied to it. The new stylesheet has different class names. How do I map styles from the old stylesheet to the styles in the new stylesheet so that I do't have to manually apply the new styles?
Many thanks!
P
Mapping styles between 2 stylesheets
Re: Mapping styles between 2 stylesheets
Two options.
Option 1: Copy-and-paste the styles from the second stylesheet into the project's primary stylesheet.
Option 2: Keep both stylesheets in the project, but in the project's primary stylesheet, add a reference to the other stylesheet. I think the code you would add to the main stylesheet would be similar to the following:
Where secondStyles.css is the name of the second stylesheet. However, that assumes that the stylesheet is stored in the same directory as the main stylesheet. If it isn't, then you'll have to add the relevant path information before the file name.
That import reference should be at the top of the main stylesheet, so if you have two classes defined the same way, the styles in the main stylesheet will win because they'll be listed after the styles from the import stylesheet.
Someone correct me if I'm wrong about that line of code. I know you can do it, but I'm not entirely sure I'm showing the right code.
Option 1: Copy-and-paste the styles from the second stylesheet into the project's primary stylesheet.
Option 2: Keep both stylesheets in the project, but in the project's primary stylesheet, add a reference to the other stylesheet. I think the code you would add to the main stylesheet would be similar to the following:
Code: Select all
@import url(secondStyles.css);That import reference should be at the top of the main stylesheet, so if you have two classes defined the same way, the styles in the main stylesheet will win because they'll be listed after the styles from the import stylesheet.
Someone correct me if I'm wrong about that line of code. I know you can do it, but I'm not entirely sure I'm showing the right code.
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: Mapping styles between 2 stylesheets
Thanks. I'm not quite sure if this will help me, but I" probably just missing something.
Will these options take care of the following scenario?
I have a style called p.BO_Body in my stylesheet. I have a style called p.Body in my new stylesheet. I want all current instances of p.BO_Body to have p.Body applied to them.
Cheers,
P
Will these options take care of the following scenario?
I have a style called p.BO_Body in my stylesheet. I have a style called p.Body in my new stylesheet. I want all current instances of p.BO_Body to have p.Body applied to them.
Cheers,
P
Re: Mapping styles between 2 stylesheets
No, you'd have to do a find-and-replace in the source code of all the topics in the project to change all instances of <p class="BO_Body" to <p class="Body". So if the project's main stylesheet has p.Body in it but some of your topics have paragraphs using p.BO_Body, then you do the F&R to change which class the paragraph is using.
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: Mapping styles between 2 stylesheets
Gotcha. Thanks very much!
P
P