Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current version of less breaks media query aspect ratios #69

Closed
JamesMcIntosh opened this issue Jun 22, 2018 · 8 comments
Closed

Current version of less breaks media query aspect ratios #69

JamesMcIntosh opened this issue Jun 22, 2018 · 8 comments
Labels

Comments

@JamesMcIntosh
Copy link

JamesMcIntosh commented Jun 22, 2018

Version 3.0.4 of less is not yet a very good and stable release.

They have broken things like aspect ratios, see:
less/less.js#1880

Having a media query like the following breaks because it is "16/9" is converted to a decimal 1.7777778
@media (max-width: 50em) and (max-aspect-ratio: 16/9)

@matthew-dean
Copy link

@JamesMcIntosh - How to treat the "/" character has been an issue for all versions of Less. It's not a new problem for 3.x.

@jonycheung
Copy link
Owner

Per @matthew-dean closing this issue since it's not something watcher can fix

@JamesMcIntosh
Copy link
Author

JamesMcIntosh commented Oct 16, 2018

This is something that can be fixed, less/less.js#3205 fixed this problem, upgrade the LESS dependency to version 3.8.1

@jonycheung
Copy link
Owner

jonycheung commented Oct 16, 2018

Just released an update @1.11.7 with less 3.8.1. Hope this solves the problem.

@JamesMcIntosh
Copy link
Author

Awesome, I'll give it a test!

@JamesMcIntosh
Copy link
Author

This LESS version does fix the problem but it requires a command line option to enable the functionality, see the math section http://lesscss.org/usage/#less-options

Looks like updating the lessWatchCompilerUtils.js compileCSS function adding

var math = lessWatchCompilerUtilsModule.config.math ? ' --math=' + lessWatchCompilerUtilsModule.config.math  : '';
...
var command = 'lessc' + math + sourceMap + enableJsFlag + minifiedFlag + plugins + ' ' + JSON.stringify(file) + ' ' + outputFilePath;

and adding the option to less-watch-compiler.js init() function

if (program.math) lessWatchCompilerUtils.config.math = program.math;

Should be enough to activate the functionality, I'll look at a PR.

@JamesMcIntosh
Copy link
Author

JamesMcIntosh commented Oct 23, 2018

PR #77 adds the functionality and improves the setup of the unit tests to stop configuration accidentally spilling over between tests.

@jonycheung jonycheung reopened this Oct 26, 2018
jonycheung added a commit that referenced this issue Oct 30, 2018
…uery

#69 - Add ability to specify any LESS options
@jonycheung
Copy link
Owner

You can now pass less options in 1.13.0 using --less-args

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants