1

I'm experiencing a peculiar issue and I'm having trouble diagnosing it.

I am using LessJs in an ASP.NET MVC web application and the less file is not being processed and I am seeing my variables in the "F12" debug tools -- and the style is not applied as expected as a bi-product.

The markup looks like this.

@Scripts.Render("~/bundles/modernizr")
<link href="~/Content/bootstrap.css" rel="stylesheet" />
<link href="~/Content/site.less" rel="stylesheet" />
<script src="~/Scripts/less-1.5.1.min.js" type="text/javascript"></script>

I am seeing the files correctly delivered to the browser (from Network tab)

Network Traffic

There are NO errors in the console.

but when I inspect my element, I see this:

CSS error in Browser

The styles from bootstrap.css are applied as expected.

Am I missing a step? I've used less with ASP.NET before, this one's got me stumped.

Thanks!

2
  • I see that there is frendly which propably should be friendly. Didn't you change the file accidentally? Commented May 22, 2015 at 13:39
  • 1
    @XaweryWiśniowiecki -- good catch. its actually wrong in both places haha. but the point is that you shouldn't see it at all once the content is delivered to the browser, its supposed to be parsed and replaced with an hex representation of a color. Commented May 22, 2015 at 14:10

1 Answer 1

1

Solved. This issue was that the link tag that references the less files had an incorrect rel attribute. For less it should be stylesheet/less as opposed to just stylesheet, which is used for CSS.

<link href="~/Content/site.less" rel="stylesheet/less" type="text/css" />
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.