R
R
Roman Koff2018-02-27 13:07:13
Sass
Roman Koff, 2018-02-27 13:07:13

How to import scss from url correctly?

There is the following file structure:

styles/
  fonts/
    _fonts.cscc
    font1.woff
  theme.scss

Contents of _fonts.cscc:
@font-face {
  font-family: "font1";
  src: local("font1-Regular"), url("font1.woff") format("woff");
  font-weight: 400;
  font-style: normal;
}

In the theme.scss file, I import the fonts/_fonts.cscc file: When compiling, the path to the font resource is not modified:
@import "fonts/_fonts.cscc";
@font-face {
  font-family: "font1";
  src: local("font1-Regular"), url("font1.woff") format("woff");
  font-weight: 400;
  font-style: normal; }

I used LESS before, where the path was modified to url('fonts/font1.woff')).
How is this task solved in SASS/SCSS?
(I'm using VS and the Web Essentails addon)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Matvey Phoenix, 2018-06-27
@mtvphnx

Write paths relative to the place where the future css will lie.
For example, in the following structure:
In the main.sass file, I write the path to the font, starting from the main.css file This task is not solved automatically. url('./../fonts/font.woff') format('woff')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question