‎Jun 2, 2020 12:57 PM - edited ‎Jun 2, 2020 1:02 PM
Hi, I have the project organized like so:
📂 CSS |__📂 MACROS |__📄 macros.css |__📂 TYPOGRAPHY |__📄 types.css |__📄 THEME.CSS
Inside the theme.css file, I load all macros:
import .... macros.css
import .... typhograpy.css
the problem is that inside the file typography.css the macros won't work.
This works with HTML files, I can import a macro in the HEADER of the HTML file and all imported files work with the same macros.
In CSS I need to import the macros in all CSS files. This is a pain.
EDIT: also tried include, none work
Solved! Go to Solution.
‎Jun 10, 2020 11:25 AM
macros have to be added directly to the css file calling the macro. So you would need to import macros.css into typhograpy.css.
‎Jun 10, 2020 11:25 AM
macros have to be added directly to the css file calling the macro. So you would need to import macros.css into typhograpy.css.
‎Jun 17, 2020 9:44 AM
Yep, each CSS file that needs to use the macro, needs to import them.
‎Jun 9, 2020 10:58 AM
Hi @igcorreia,
@all - corrrect me if i'm wrong, but as far as i know, this isn't possible with basic css.
The @import statement will drop all non css statements such as variables and macros.
You will need to include these on every css file.
If you code locally:
There is also the option to switch to SCSS / Sass which has simulare statements.
In SCSS/Sass you have to compile the files, which compile your macros and variable to basic css.
- Chris
‎Jun 9, 2020 6:23 AM
Hey @igcorreia
Thank you for the information provided.I'll tag a few experts that can share their experience with you.
Hey @krishangtechn @david_eic @Chris-M any thoughts you would like to share with @igcorreia?
Thanks
Sharon
![]() | ¿SabÃas que la Comunidad está disponible en Español? ¡Participa hoy en conversaciones en el idioma de tu preferencia,cambiando el idioma en tus configuraciones! Did you know that the Community is available in other languages? Join regional conversations by changing your language settings ! |