Jump to content
Search Community

SyntaxTextShadow Error: "" string literal contains an unescaped line break

Winslow test
Moderator Tag

Recommended Posts

Just cannot figure this syntax! Quotes, no quotes, before comma,  after comma, color first, color last, no comma.... Can't find any examples of shadowing with multiple values. Anyone take a peak and enlighten me. Codepen attached however this statement errors out so it is commented for the time being.  I have it in CSS but prefer to add and remove classes.

 

Thanks,

 

This is the textShadow:

 

var shadow = "0 1px 0 hsl(43, 35%, 47%), 0 2px 0 hsl(43, 35%, 40%),
        0 3px 0 hsl(44, 35%, 35%), 0 4px 0 hsl(44, 35%, 30%),
        0 5px 0 hsl(44, 35%, 27%), 0 6px 0 hsl(43, 35%, 25%),
        0 7px 0 hsl(42, 35%, 23%), 0 8px 0 hsl(42, 35%, 21%),
        0 0 1px rgba(162, 138, 78, 0.05), 0 1px 3px rgba(162, 138, 78, 0.2),
        0 3px 4px rgba(162, 138, 78, 0.2), 0 5px 5px rgba(162, 138, 78, 0.2),
        0 10px 6px rgba(162, 138, 78, 0.2), 0 20px 7px rgba(162, 138, 78, 0.3)";

 

See the Pen zYGaeOx?editors=0010 by B0nef1sh (@B0nef1sh) on CodePen

Link to comment
Share on other sites

That's not valid JavaScript. You can use backticks for multi-line strings.

 

const shadow = `0 1px 0 hsl(43, 35%, 47%), 0 2px 0 hsl(43, 35%, 40%),
				0 3px 0 hsl(44, 35%, 35%), 0 4px 0 hsl(44, 35%, 30%),
				0 5px 0 hsl(44, 35%, 27%), 0 6px 0 hsl(43, 35%, 25%),
				0 7px 0 hsl(42, 35%, 23%), 0 8px 0 hsl(42, 35%, 21%),
				0 0 1px rgba(162, 138, 78, 0.05), 0 1px 3px rgba(162, 138, 78, 0.2),
				0 3px 4px rgba(162, 138, 78, 0.2), 0 5px 5px rgba(162, 138, 78, 0.2),
				0 10px 6px rgba(162, 138, 78, 0.2), 0 20px 7px rgba(162, 138, 78, 0.3)`;

 

 

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...