1

I have the following css code:

div {
  --height: 1.5em;
  line-height: var(--height);
  background-image: repeating-linear-gradient(transparent 0 var(--height), green var(--height) calc(var(--height) * 2));
}
<div>Stack Overflow is a question and answer website for professional and enthusiast programmers. It is the flagship site of the Stack Exchange Network,[4][5][6] created in 2008 by Jeff Atwood and Joel Spolsky.[7][8] It features questions and answers on a
  wide range of topics in computer programming.[9][10][11] It was created to be a more open alternative to earlier question and answer websites such as Experts-Exchange. Stack Overflow was sold to Prosus, a Netherlands-based consumer internet conglomerate,
  on 2 June 2021 for $1.8 billion.[12]</div>

This css code does work well, but I am not sure why, the sublime text don't recognize the calc() as a built-in function.

It does display properly even though the sublime text doesn't recognize the calc(), but could anyone explain to me a little bit why this happens?

It looks something like this:

like this

Thanks for any responds!

mplungjan
  • 169,008
  • 28
  • 173
  • 236
James
  • 2,732
  • 2
  • 5
  • 28
  • 2
    in vscode there isn't any issue, I think is a sublime IDE problem. – Laaouatni Anas Dec 25 '21 at 12:32
  • 3
    Sublime is not an IDE, but also keep in mind that it doesn't matter what Sublime thinks is valid or invalid because it's your browser that interprets the code you write (be it CSS, HTML, Python or anything else) so syntax definition issues such as the one seen here don't affect the code. Regardless of that though, assuming that this is valid CSS the syntax definition for CSS in Sublime has an issue. Reporting it will help to get it fixed; you can do so at: https://github.com/sublimehq/Packages/issues/new/choose – OdatNurd Dec 25 '21 at 17:16

0 Answers0