How to get the CSS that was defined on another page?

1
Hello, I'm new to front-end development, sorry if my question is kind of rough, but what I would like to know is if it is possible to get the CSS file that was defined on a page and use that same CSS in the too much. This project uses Velocity, so I was thinking of something like:

A file called style.vm for example

<HTML>
   <HEAD>
       #IF(cliente == 1)
       <link rel="stylesheet" type="text/css" href="cliente1.css">
       #ELSE IF (cliente == 2)
       <link rel="stylesheet" type="text/css" href="cliente2.css">
       #ELSE IF (cliente == 3)
       <link rel="stylesheet" type="text/css" href="cliente3.css">
       #ELSE IF (cliente == 4)
       <link rel="stylesheet" type="text/css" href="cliente4.css">
       .
       .
       .
       #END
   <HEAD>
</HTML>

and in the other .VMs and .JSPs you get the css that was defined in that file, because you did not want to copy all those IFs to each project file. I have the option of using JQuery if necessary, as all pages of this project import JQuery.

    
asked by anonymous 24.06.2015 / 05:42

2 answers

2

Could do as follows

<link rel="stylesheet" type="text/css" href="cliente[$cliente].css">

That's enough, I would not need the conditional if.

obs: instead of [$cliente] , put the variable cliente of "velocity"

    
24.06.2015 / 08:22
0

Generally when a client is logged into the system it takes this information in the session, what you could do was set different themes for the system, and assign a theme that would call the css file. For this I think you should use some language for the application backend if you do not use it.

So storing the data in a database you could print in the style link the theme of the user you are accessing.

    
24.06.2015 / 06:58