├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── bin └── lessc.dart ├── build.yaml ├── example ├── custom_functions_example.dart ├── example.dart └── less_custom_builder.dart ├── lib ├── less.dart ├── less_builder.dart ├── src │ ├── cleancss_options.dart │ ├── contexts.dart │ ├── data │ │ ├── colors.dart │ │ ├── constants.dart │ │ └── unit_conversions.dart │ ├── environment │ │ ├── abstract_file_manager.dart │ │ ├── base64_string.dart │ │ ├── bi_map.dart │ │ ├── debug_functions.dart │ │ ├── environment.dart │ │ ├── file_file_manager.dart │ │ ├── global_functions.dart │ │ ├── image_size.dart │ │ ├── more_list.dart │ │ ├── more_reg_exp.dart │ │ ├── number_formatter.dart │ │ ├── package_resolver_provider.dart │ │ └── url_file_manager.dart │ ├── file_info.dart │ ├── functions │ │ ├── boolean_functions.dart │ │ ├── color_blend.dart │ │ ├── color_functions.dart │ │ ├── data_uri_functions.dart │ │ ├── default_func.dart │ │ ├── function_base.dart │ │ ├── function_caller.dart │ │ ├── function_registry.dart │ │ ├── functions.dart │ │ ├── image_size_functions.dart │ │ ├── list_functions.dart │ │ ├── math_functions.dart │ │ ├── math_helper.dart │ │ ├── number_functions.dart │ │ ├── string_functions.dart │ │ ├── svg_functions.dart │ │ └── types_functions.dart │ ├── import_manager.dart │ ├── index.dart │ ├── less_error.dart │ ├── less_options.dart │ ├── lessc_helper.dart │ ├── logger.dart │ ├── output.dart │ ├── parser │ │ ├── charcode.dart │ │ ├── chunker.dart │ │ ├── entities.dart │ │ ├── mixin.dart │ │ ├── parse_node.dart │ │ ├── parser.dart │ │ ├── parser_input.dart │ │ └── parsers.dart │ ├── plugins │ │ ├── less_plugin_advanced_color_functions │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── advanced_color_functions.dart │ │ │ └── less_plugin_advanced_color_functions.dart │ │ ├── less_plugin_clean_css │ │ │ ├── LICENSE │ │ │ ├── OPTIMIZATIONS.md │ │ │ ├── README.md │ │ │ ├── clean_css_compatibility.dart │ │ │ ├── clean_css_context.dart │ │ │ ├── clean_css_options.dart │ │ │ ├── clean_css_processor.dart │ │ │ ├── clean_css_visitor.dart │ │ │ └── less_plugin_clean_css.dart │ │ ├── plugin.dart │ │ ├── plugin_loader.dart │ │ ├── plugin_manager.dart │ │ ├── plugins.dart │ │ └── processor.dart │ ├── render │ │ ├── parse_tree.dart │ │ ├── render.dart │ │ └── transform_tree.dart │ ├── sourcemap │ │ ├── source_map_builder.dart │ │ ├── source_map_output.dart │ │ └── sourcemap.dart │ ├── tree │ │ ├── anonymous.dart │ │ ├── apply.dart │ │ ├── assignment.dart │ │ ├── at_rule.dart │ │ ├── attribute.dart │ │ ├── call.dart │ │ ├── color.dart │ │ ├── combinator.dart │ │ ├── comment.dart │ │ ├── condition.dart │ │ ├── debug_info.dart │ │ ├── declaration.dart │ │ ├── detached_ruleset.dart │ │ ├── dimension.dart │ │ ├── directive_base.dart │ │ ├── element.dart │ │ ├── expression.dart │ │ ├── extend.dart │ │ ├── import.dart │ │ ├── javascript.dart │ │ ├── js_eval_node_mixin.dart │ │ ├── keyword.dart │ │ ├── media.dart │ │ ├── merge_rules_mixin.dart │ │ ├── mixin_call.dart │ │ ├── mixin_definition.dart │ │ ├── namespace_value.dart │ │ ├── negative.dart │ │ ├── node.dart │ │ ├── nodeset.dart │ │ ├── operation.dart │ │ ├── options.dart │ │ ├── output_ruleset_mixin.dart │ │ ├── paren.dart │ │ ├── property.dart │ │ ├── quoted.dart │ │ ├── ruleset.dart │ │ ├── selector.dart │ │ ├── tree.dart │ │ ├── tree_api.dart │ │ ├── unicode_descriptor.dart │ │ ├── unit.dart │ │ ├── url.dart │ │ ├── value.dart │ │ ├── variable.dart │ │ └── variable_call.dart │ ├── utils.dart │ └── visitor │ │ ├── css_visitor_utils.dart │ │ ├── extend_finder_visitor.dart │ │ ├── ignition_visitor.dart │ │ ├── import_detector.dart │ │ ├── import_visitor.dart │ │ ├── join_selector_visitor.dart │ │ ├── process_extends_visitor.dart │ │ ├── set_tree_visibility_visitor.dart │ │ ├── to_css_visitor.dart │ │ ├── visitor.dart │ │ └── visitor_base.dart └── src_builder │ ├── base_builder.dart │ ├── dot_html_builder.dart │ ├── dot_less_builder.dart │ ├── entry_points.dart │ └── less_builder_options.dart ├── pubspec.yaml └── test ├── banner.txt ├── batch_test.dart ├── benchmark ├── benchmark.dart ├── benchmark.less ├── big1.less ├── full_benchmark.dart ├── gen.less.sh ├── run.sh └── vm_common.dart ├── builder_test.dart ├── cleancss ├── cleancss │ ├── colors-no.css │ ├── main-ie7.css │ ├── main-ie8.css │ ├── main-skip-advanced.css │ └── main.css ├── colors.css ├── css-3.css └── css-clean.css ├── cleancss_test.dart ├── css ├── 3rd-party │ └── bootstrap.css ├── calc.css ├── charsets.css ├── colors.css ├── comments.css ├── comments2.css ├── compression │ └── compression.css ├── css-3.css ├── css-escapes.css ├── css-grid.css ├── css-guards.css ├── debug │ ├── linenumbers-all.css │ ├── linenumbers-comments.css │ └── linenumbers-mediaquery.css ├── detached-rulesets.css ├── directives-bubling.css ├── empty.css ├── extend-chaining.css ├── extend-clearfix.css ├── extend-exact.css ├── extend-media.css ├── extend-nest.css ├── extend-selector.css ├── extend.css ├── extendedTest │ ├── apply.css │ ├── colors.css │ ├── function-rem.css │ ├── image-size.css │ ├── import-complex-path.css │ ├── import-package-lib.css │ ├── import-package.css │ ├── options-import.css │ ├── options-plugin.css │ ├── options-strict-math.css │ ├── plugin-advanced-color.css │ ├── svg.css │ └── url.css ├── extract-and-length.css ├── filemanagerPlugin │ └── filemanager.css ├── functions-each.css ├── functions.css ├── globalVars │ ├── extended.css │ └── simple.css ├── ie-filters.css ├── import-absolute-path.css ├── import-inline.css ├── import-interpolation.css ├── import-once.css ├── import-reference-issues.css ├── import-reference.css ├── import.css ├── include-path-string │ └── include-path-string.css ├── include-path │ └── include-path.css ├── javascript.css ├── lazy-eval.css ├── legacy │ └── legacy.css ├── math │ ├── parens-division │ │ ├── media-math.css │ │ ├── mixins-args.css │ │ ├── new-division.css │ │ └── parens.css │ ├── strict-legacy │ │ ├── css.css │ │ ├── media-math.css │ │ ├── mixins-args.css │ │ └── parens.css │ └── strict │ │ ├── css.css │ │ ├── media-math.css │ │ ├── mixins-args.css │ │ └── parens.css ├── media.css ├── merge.css ├── mixins-closure.css ├── mixins-guards-default-func.css ├── mixins-guards.css ├── mixins-important.css ├── mixins-interpolated.css ├── mixins-named-args.css ├── mixins-nested.css ├── mixins-pattern.css ├── mixins.css ├── modifyVars │ └── extended.css ├── namespacing │ ├── namespacing-1.css │ ├── namespacing-2.css │ ├── namespacing-3.css │ ├── namespacing-4.css │ ├── namespacing-5.css │ ├── namespacing-6.css │ ├── namespacing-7.css │ ├── namespacing-functions.css │ ├── namespacing-media.css │ └── namespacing-operations.css ├── no-output.css ├── no-strict-math │ ├── mixins-guards.css │ └── no-sm-operations.css ├── operations.css ├── parse-interpolation.css ├── permissive-parse.css ├── plugin-preeval.css ├── plugin.css ├── postProcessorPlugin │ └── postProcessor.css ├── preProcessorPlugin │ └── preProcessor.css ├── property-accessors.css ├── property-name-interp.css ├── rewrite-urls-all │ └── rewrite-urls-all.css ├── rewrite-urls-local │ └── rewrite-urls-local.css ├── rootpath-rewrite-urls-all │ └── rootpath-rewrite-urls-all.css ├── rootpath-rewrite-urls-local │ └── rootpath-rewrite-urls-local.css ├── rulesets.css ├── scope.css ├── selectors.css ├── sourcemaps-empty │ └── empty.css ├── static-urls │ └── urls.css ├── strict-units │ └── strict-units.css ├── strings.css ├── url-args │ └── urls.css ├── urls.css ├── variables-in-at-rules.css ├── variables.css ├── visitorPlugin │ └── visitor.css └── whitespace.css ├── data ├── data-uri-fail.png ├── image-size-lossless.webp ├── image-size-lossy.webp ├── image-size.bmp ├── image-size.gif ├── image-size.jpg ├── image-size.png ├── image-size.psd ├── image-size.svg ├── image.jpg ├── image.svg └── page.html ├── less ├── 3rd-party │ └── bootstrap.less ├── calc.less ├── charsets.less ├── cleancss │ ├── colors-no.less │ ├── main-ie7.less │ ├── main-ie8.less │ ├── main-skip-advanced.less │ └── main.less ├── colors.less ├── comments.less ├── comments2.less ├── compression │ └── compression.less ├── css-3.less ├── css-clean.less ├── css-escapes.less ├── css-grid.less ├── css-guards.less ├── debug │ ├── import │ │ └── test.less │ └── linenumbers.less ├── detached-rulesets.less ├── directives-bubling.less ├── empty.less ├── errors │ ├── add-mixed-units.less │ ├── add-mixed-units.txt │ ├── add-mixed-units2.less │ ├── add-mixed-units2.txt │ ├── at-rules-undefined-var.less │ ├── at-rules-undefined-var.txt │ ├── at-rules-unmatching-block.less │ ├── at-rules-unmatching-block.txt │ ├── bad-variable-declaration1.less │ ├── bad-variable-declaration1.txt │ ├── color-func-invalid-color-2.less │ ├── color-func-invalid-color-2.txt │ ├── color-func-invalid-color.less │ ├── color-func-invalid-color.txt │ ├── comment-in-selector.less │ ├── comment-in-selector.txt │ ├── css-guard-default-func.less │ ├── css-guard-default-func.txt │ ├── custom-property-unmatched-block-1.less │ ├── custom-property-unmatched-block-1.txt │ ├── custom-property-unmatched-block-2.less │ ├── custom-property-unmatched-block-2.txt │ ├── custom-property-unmatched-block-3.less │ ├── custom-property-unmatched-block-3.txt │ ├── detached-ruleset-1.less │ ├── detached-ruleset-1.txt │ ├── detached-ruleset-2.less │ ├── detached-ruleset-2.txt │ ├── detached-ruleset-3.less │ ├── detached-ruleset-3.txt │ ├── detached-ruleset-5.less │ ├── detached-ruleset-5.txt │ ├── detached-ruleset-6.less │ ├── detached-ruleset-6.txt │ ├── divide-mixed-units.less │ ├── divide-mixed-units.txt │ ├── extend-no-selector.less │ ├── extend-no-selector.txt │ ├── extend-not-at-end.less │ ├── extend-not-at-end.txt │ ├── functions-1.less │ ├── functions-1.txt │ ├── functions-10-keyword.less │ ├── functions-10-keyword.txt │ ├── functions-11-operation.less │ ├── functions-11-operation.txt │ ├── functions-12-quoted.less │ ├── functions-12-quoted.txt │ ├── functions-13-selector.less │ ├── functions-13-selector.txt │ ├── functions-14-url.less │ ├── functions-14-url.txt │ ├── functions-15-value.less │ ├── functions-15-value.txt │ ├── functions-3-assignment.less │ ├── functions-3-assignment.txt │ ├── functions-4-call.less │ ├── functions-4-call.txt │ ├── functions-5-color-2.less │ ├── functions-5-color-2.txt │ ├── functions-5-color.less │ ├── functions-5-color.txt │ ├── functions-6-condition.less │ ├── functions-6-condition.txt │ ├── functions-7-dimension.less │ ├── functions-7-dimension.txt │ ├── functions-8-element.less │ ├── functions-8-element.txt │ ├── functions-9-expression.less │ ├── functions-9-expression.txt │ ├── import-malformed.less │ ├── import-malformed.txt │ ├── import-missing.less │ ├── import-missing.txt │ ├── import-no-semi.less │ ├── import-no-semi.txt │ ├── import-subfolder1.less │ ├── import-subfolder1.txt │ ├── import-subfolder2-chunker.txt │ ├── import-subfolder2.less │ ├── import-subfolder2.txt │ ├── imports │ │ ├── import-subfolder1.less │ │ ├── import-subfolder2.less │ │ ├── import-test.less │ │ └── subfolder │ │ │ ├── mixin-not-defined.less │ │ │ └── parse-error-curly-bracket.less │ ├── javascript-error.less │ ├── javascript-error.txt │ ├── javascript-undefined-var.less │ ├── javascript-undefined-var.txt │ ├── mixed-mixin-definition-args-1.less │ ├── mixed-mixin-definition-args-1.txt │ ├── mixed-mixin-definition-args-2.less │ ├── mixed-mixin-definition-args-2.txt │ ├── mixin-not-defined-2.less │ ├── mixin-not-defined-2.txt │ ├── mixin-not-defined.less │ ├── mixin-not-defined.txt │ ├── mixin-not-matched.less │ ├── mixin-not-matched.txt │ ├── mixin-not-matched2.less │ ├── mixin-not-matched2.txt │ ├── mixin-not-visible-in-scope-1.less │ ├── mixin-not-visible-in-scope-1.txt │ ├── mixins-guards-cond-expected.less │ ├── mixins-guards-cond-expected.txt │ ├── mixins-guards-default-func-1.less │ ├── mixins-guards-default-func-1.txt │ ├── mixins-guards-default-func-2.less │ ├── mixins-guards-default-func-2.txt │ ├── mixins-guards-default-func-3.less │ ├── mixins-guards-default-func-3.txt │ ├── multiple-guards-on-css-selectors.less │ ├── multiple-guards-on-css-selectors.txt │ ├── multiple-guards-on-css-selectors2.less │ ├── multiple-guards-on-css-selectors2.txt │ ├── multiply-mixed-units.less │ ├── multiply-mixed-units.txt │ ├── namespacing-2.less │ ├── namespacing-2.txt │ ├── namespacing-3.less │ ├── namespacing-3.txt │ ├── namespacing-4.less │ ├── namespacing-4.txt │ ├── parens-error-1.less │ ├── parens-error-1.txt │ ├── parens-error-2.less │ ├── parens-error-2.txt │ ├── parens-error-3.less │ ├── parens-error-3.txt │ ├── parse-error-curly-bracket.less │ ├── parse-error-curly-bracket.txt │ ├── parse-error-media-no-block-1.less │ ├── parse-error-media-no-block-1.txt │ ├── parse-error-media-no-block-2.less │ ├── parse-error-media-no-block-2.txt │ ├── parse-error-media-no-block-3.less │ ├── parse-error-media-no-block-3.txt │ ├── parse-error-missing-bracket.less │ ├── parse-error-missing-bracket.txt │ ├── parse-error-missing-parens.less │ ├── parse-error-missing-parens.txt │ ├── parse-error-with-import.less │ ├── parse-error-with-import.txt │ ├── percentage-missing-space.less │ ├── percentage-missing-space.txt │ ├── percentage-non-number-argument.less │ ├── percentage-non-number-argument.txt │ ├── percentage-non-number-argument.txt.bak │ ├── property-asterisk-only-name.less │ ├── property-asterisk-only-name.txt │ ├── property-ie5-hack.less │ ├── property-ie5-hack.txt │ ├── property-in-root.less │ ├── property-in-root.txt │ ├── property-in-root2.less │ ├── property-in-root2.txt │ ├── property-in-root3.less │ ├── property-in-root3.txt │ ├── property-interp-not-defined.less │ ├── property-interp-not-defined.txt │ ├── recursive-variable.less │ ├── recursive-variable.txt │ ├── root-func-undefined-1.less │ ├── root-func-undefined-1.txt │ ├── root-func-undefined-2.less │ ├── root-func-undefined-2.txt │ ├── single-character.less │ ├── single-character.txt │ ├── svg-gradient1.less │ ├── svg-gradient1.txt │ ├── svg-gradient2.less │ ├── svg-gradient2.txt │ ├── svg-gradient3.less │ ├── svg-gradient3.txt │ ├── svg-gradient4.less │ ├── svg-gradient4.txt │ ├── svg-gradient5.less │ ├── svg-gradient5.txt │ ├── svg-gradient6.less │ ├── svg-gradient6.txt │ ├── unit-function.less │ └── unit-function.txt ├── extend-chaining.less ├── extend-clearfix.less ├── extend-exact.less ├── extend-media.less ├── extend-nest.less ├── extend-selector.less ├── extend.less ├── extendedTest │ ├── apply.less │ ├── colors.less │ ├── function-rem.less │ ├── image-size.less │ ├── import-complex-path.less │ ├── import-package-lib.less │ ├── import-package.less │ ├── options-import.less │ ├── options-plugin.less │ ├── options-strict-math.less │ ├── plugin-advanced-color.less │ ├── svg.less │ └── url.less ├── extract-and-length.less ├── filemanagerPlugin │ ├── colors.test │ └── filemanager.less ├── functions-each.less ├── functions.less ├── globalVars │ ├── extended.json │ ├── extended.less │ ├── simple.json │ └── simple.less ├── ie-filters.less ├── import-absolute-path.less ├── import-inline.less ├── import-interpolation.less ├── import-once.less ├── import-packages │ └── test.less ├── import-reference-issues.less ├── import-reference-issues │ ├── appender-reference-1968.less │ ├── global-scope-import.less │ ├── global-scope-nested.less │ ├── mixin-1968.less │ ├── multiple-import-nested.less │ ├── multiple-import.less │ ├── simple-mixin.css │ └── simple-ruleset-2162.less ├── import-reference.less ├── import.less ├── import │ ├── css-import.less │ ├── deeper │ │ ├── deeper-2 │ │ │ ├── url-import-2.less │ │ │ └── url-import.less │ │ ├── import-once-test-a.less │ │ └── url-import.less │ ├── import-and-relative-paths-test.less │ ├── import-charset-test.less │ ├── import-inline-invalid-css.less │ ├── import-interpolation.less │ ├── import-interpolation2.less │ ├── import-once-test-c.less │ ├── import-reference.less │ ├── import-test-a.less │ ├── import-test-b.less │ ├── import-test-c.less │ ├── import-test-d.css │ ├── import-test-e.less │ ├── import-test-f.less │ ├── imports │ │ ├── font.less │ │ └── logo.less │ ├── interpolation-vars.less │ ├── invalid-css.less │ └── urls.less ├── include-path-string │ └── include-path-string.less ├── include-path │ └── include-path.less ├── javascript.less ├── lazy-eval.less ├── legacy │ └── legacy.less ├── math │ ├── parens-division │ │ ├── media-math.less │ │ ├── mixins-args.less │ │ ├── new-division.less │ │ └── parens.less │ ├── strict-legacy │ │ ├── css.less │ │ ├── media-math.less │ │ ├── mixins-args.less │ │ └── parens.less │ └── strict │ │ ├── css.less │ │ ├── media-math.less │ │ ├── mixins-args.less │ │ └── parens.less ├── media.less ├── merge.less ├── mixins-closure.less ├── mixins-guards-default-func.less ├── mixins-guards.less ├── mixins-important.less ├── mixins-interpolated.less ├── mixins-named-args.less ├── mixins-nested.less ├── mixins-pattern.less ├── mixins.less ├── modifyVars │ ├── extended.json │ └── extended.less ├── namespacing │ ├── imports │ │ ├── a-better-bootstrap.less │ │ └── library.less │ ├── namespacing-1.less │ ├── namespacing-2.less │ ├── namespacing-3.less │ ├── namespacing-4.less │ ├── namespacing-5.less │ ├── namespacing-6.less │ ├── namespacing-7.less │ ├── namespacing-functions.less │ ├── namespacing-media.less │ └── namespacing-operations.less ├── nested-gradient-with-svg-gradient │ ├── mixin-consumer.less │ └── svg-gradient-mixin.less ├── no-js-errors │ ├── no-js-errors.less │ └── no-js-errors.txt ├── no-output.less ├── no-strict-math │ ├── mixins-guards.less │ └── no-sm-operations.less ├── operations.less ├── parse-interpolation.less ├── permissive-parse.less ├── plugin-preeval.less ├── plugin.less ├── plugin │ └── plugin-transitive.less ├── postProcessorPlugin │ └── postProcessor.less ├── preProcessorPlugin │ └── preProcessor.less ├── property-accessors.less ├── property-name-interp.less ├── rewrite-urls-all │ ├── folder │ │ └── file.less │ └── rewrite-urls-all.less ├── rewrite-urls-local │ ├── folder │ │ └── file.less │ └── rewrite-urls-local.less ├── rootpath-rewrite-urls-all │ ├── folder │ │ └── file.less │ └── rootpath-rewrite-urls-all.less ├── rootpath-rewrite-urls-local │ ├── folder │ │ └── file.less │ └── rootpath-rewrite-urls-local.less ├── rulesets.less ├── scope.less ├── selectors.less ├── sourcemaps-empty │ ├── empty.less │ └── var-defs.less ├── sourcemaps │ ├── basic.json │ ├── basic.less │ └── imported.css ├── static-urls │ └── urls.less ├── strict-units │ └── strict-units.less ├── strings.less ├── tree.less ├── url-args │ └── urls.less ├── urls.less ├── variables-in-at-rules.less ├── variables.less ├── visitorPlugin │ └── visitor.less └── whitespace.less ├── less_options_test.dart ├── packages_import_test.dart ├── plugins ├── filemanager.dart ├── functions.dart ├── plugin_preeval.dart ├── plugin_set_options.dart ├── plugin_tree_node.dart ├── postprocess.dart ├── preprocess.dart └── visitor.dart ├── simply_test.dart ├── to_tree_test.dart ├── transformer ├── index_result.html └── index_source.html └── webSourceMap ├── banner.txt ├── custom-props-expected.css ├── custom-props.css ├── custom-props.css-expected.map ├── custom-props.css.map ├── custom-props.less ├── import-inline.less ├── import.less ├── index-expected.css ├── index-expected.map ├── index-less-inline-expected.css ├── index-less-inline-expected.map ├── index-less-inline.css ├── index-less-inline.less ├── index-less-inline.map ├── index-map-inline-expected.css ├── index-map-inline.css ├── index-map-inline.less ├── index.css ├── index.html ├── index.less └── index.map /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ignore 2 | packages 3 | result 4 | pubspec.lock 5 | .packages 6 | .pub 7 | .settings 8 | .tags 9 | .tags1 10 | *.iml 11 | /doc 12 | node_modules/ 13 | /.atom 14 | /.dart_tool 15 | /.idea 16 | /.project 17 | -------------------------------------------------------------------------------- /bin/lessc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | import 'package:less_dart/less.dart'; 4 | 5 | Future main(List args) { 6 | final less = Less(); 7 | 8 | //TODO stdin 9 | 10 | return less.transform(args).then((int lessExitCode) { 11 | stderr.write(less.stderr); 12 | stdout.write(less.stdout); 13 | exitCode = lessExitCode; 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /build.yaml: -------------------------------------------------------------------------------- 1 | builders: 2 | less_dart: 3 | import: 'package:less_dart/less_builder.dart' 4 | builder_factories: ['lessBuilder'] 5 | auto_apply: dependents 6 | build_extensions: 7 | .less.html: ['.html'] 8 | .less: ['.css'] 9 | applies_builders: 10 | - less_dart|less_source_cleanup 11 | defaults: 12 | options: 13 | cleancss: false 14 | compress: false 15 | # entry_points: ['*.less'] 16 | # include_path: 'lib/includes' 17 | # other_flags: [''] 18 | 19 | post_process_builders: 20 | less_source_cleanup: 21 | import: 'package:less_dart/less_builder.dart' 22 | builder_factory: 'lessSourceCleanup' 23 | defaults: 24 | release_options: 25 | enabled: true 26 | -------------------------------------------------------------------------------- /example/example.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:less_dart/less.dart'; 3 | 4 | void main() { 5 | final less = Less(); 6 | less.transform([ 7 | '-no-color', 8 | '--strict-units=on', 9 | 'test/less/colors.less' 10 | ]).then((int lessExitCode) { 11 | stderr 12 | ..write(less.stderr.toString()) 13 | ..writeln('\nstdout:') 14 | ..write(less.stdout.toString()); 15 | exitCode = lessExitCode; 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /lib/src/data/constants.dart: -------------------------------------------------------------------------------- 1 | // source: less/constants.js 3.7.1 20180718 2 | 3 | /// 4 | /// How to process math 5 | /// 6 | class MathConstants { 7 | /// Eagerly try to solve all operations 8 | static const int always = 0; 9 | 10 | /// Require parens for division "/" 11 | static const int parensDivision = 1; 12 | 13 | /// Require parens for all operations. Same as strict. 14 | static const int parens = 2; 15 | 16 | /// Legacy strict behavior (super-strict) 17 | static const int strictLegacy = 3; 18 | } 19 | 20 | /// 21 | /// Rewrite URLS to make the relative to the base less file 22 | /// 23 | class RewriteUrlsConstants { 24 | /// Don't rewrite 25 | static const int off = 0; 26 | 27 | /// Rewrites only the URLS starting with '.' 28 | static const int local = 1; 29 | 30 | /// Rewrites all URLS 31 | static const int all = 2; 32 | } 33 | -------------------------------------------------------------------------------- /lib/src/environment/debug_functions.dart: -------------------------------------------------------------------------------- 1 | part of environment.less; 2 | 3 | /// 4 | int debugCounter = 0; 5 | 6 | /// 7 | /// check type 8 | /// Example: `isType(ctxSelectors, 'Selector', isListList: true);` 9 | /// 10 | bool isType(dynamic value, String type, 11 | {bool isList = false, bool isListList = false}) { 12 | final _isList = isList || isListList; 13 | var result = true; 14 | 15 | if (value == null) return true; 16 | 17 | if (!_isList && value.runtimeType.toString() == type) return true; 18 | 19 | if (_isList && value is List) { 20 | for (var i = 0; i < value.length; i++) { 21 | if (value[i] == null) continue; 22 | if (isListList) { 23 | result = result && isType(value[i], type, isList: true); 24 | } else { 25 | if (value[i].runtimeType.toString() != type) { 26 | result = false; 27 | print('No $type: ${value[i].runtimeType} (${debugCounter++})'); 28 | } 29 | } 30 | } 31 | } else { 32 | result = false; 33 | } 34 | 35 | return result; 36 | } 37 | -------------------------------------------------------------------------------- /lib/src/environment/global_functions.dart: -------------------------------------------------------------------------------- 1 | part of environment.less; 2 | 3 | /// 4 | /// Resolves null as empty. Return false if null. 5 | /// Supports String, List, Map. 6 | /// 7 | bool isNotEmpty(dynamic value) { 8 | if (value is String) return value.isNotEmpty; 9 | if (value is List) return value.isNotEmpty; 10 | if (value is Map) return value.isNotEmpty; 11 | return false; //if value is null 12 | } 13 | 14 | /// 15 | /// -[value] int | double. Considers null value. 16 | /// 17 | T negate(T value) => (value == null) ? null : value * -1; 18 | 19 | /// 20 | /// Convert n to String, without decimal .0 if possible 21 | /// if n == 0.1 returns '0.1' 22 | /// if n == 0.0 returns '0' 23 | /// 24 | String numToString(num n) { 25 | final i = n.toInt(); 26 | return (n == i) ? i.toString() : n.toString(); 27 | } 28 | -------------------------------------------------------------------------------- /lib/src/environment/package_resolver_provider.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:package_resolver/package_resolver.dart'; 3 | 4 | export 'package:package_resolver/package_resolver.dart'; 5 | 6 | /// Package Resolver provider 7 | class PackageResolverProvider { 8 | PackageResolver _packageResolver; 9 | 10 | /// get PackageResolver instance 11 | Future getPackageResolver() async => _packageResolver ??= 12 | await PackageResolver.loadConfig(Uri.file('.packages')); 13 | } 14 | -------------------------------------------------------------------------------- /lib/src/functions/boolean_functions.dart: -------------------------------------------------------------------------------- 1 | // source: lib/less/functions/boolean.js 3.0.0 20170607 2 | 3 | part of functions.less; 4 | 5 | /// 6 | class BooleanFunctions extends FunctionBase { 7 | /// 8 | /// boolean function. Example: 9 | /// 10 | /// a: boolean(not(2 < 1)); => a: true; 11 | /// 12 | Keyword boolean(Condition condition) => 13 | condition.eval(context).evaluated ? Keyword.True() : Keyword.False(); 14 | 15 | //3.0.0 20170607 16 | // boolean: function(condition) { 17 | // return condition ? Keyword.True : Keyword.False; 18 | // }, 19 | 20 | /// 21 | /// if function. Example: 22 | /// 23 | /// a: if(not(false), 1, 2); => a: 1; 24 | /// e: if(not(true), 5); => e: ; 25 | /// 26 | @DefineMethod(name: 'if') 27 | Node ifFunction(Condition condition, Node trueValue, [Node falseValue]) => 28 | condition.eval(context).evaluated 29 | ? trueValue 30 | : (falseValue ?? Anonymous(null)); 31 | 32 | //3.0.0 20170607 33 | // 'if': function(condition, trueValue, falseValue) { 34 | // return condition ? trueValue 35 | // : (falseValue || new Anonymous); 36 | // } 37 | } 38 | -------------------------------------------------------------------------------- /lib/src/functions/default_func.dart: -------------------------------------------------------------------------------- 1 | // source: lib/less/functions/default.js 2.5.0 2 | 3 | part of functions.less; 4 | 5 | /// 6 | class DefaultFunc extends FunctionBase { 7 | LessError _error; 8 | 9 | int _value; 10 | 11 | /// 12 | @DefineMethod(name: 'default') 13 | Node eval() { 14 | final v = _value; 15 | final e = _error; 16 | 17 | if (e != null) { 18 | throw LessExceptionError(e); 19 | } 20 | if (v != null) { 21 | return (v > 0) ? Keyword.True() : Keyword.False(); 22 | } 23 | return null; 24 | 25 | // eval: function () { 26 | // var v = this.value_, e = this.error_; 27 | // if (e) { 28 | // throw e; 29 | // } 30 | // if (v != null) { 31 | // return v ? Keyword.True : Keyword.False; 32 | // } 33 | // } 34 | } 35 | 36 | /// 37 | void value(int v) { 38 | _value = v; 39 | } 40 | 41 | /// 42 | void error(LessError e) { 43 | _error = e; 44 | } 45 | 46 | /// 47 | void reset() { 48 | _value = _error = null; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/src/functions/functions.dart: -------------------------------------------------------------------------------- 1 | library functions.less; 2 | 3 | import 'dart:math' as math; 4 | import 'dart:mirrors' hide Comment; 5 | 6 | import '../contexts.dart'; 7 | import '../data/constants.dart'; 8 | import '../environment/environment.dart'; 9 | import '../file_info.dart'; 10 | import '../less_error.dart'; 11 | //import '../logger.dart'; 12 | import '../tree/tree.dart'; 13 | 14 | part 'boolean_functions.dart'; 15 | part 'color_blend.dart'; 16 | part 'color_functions.dart'; 17 | part 'data_uri_functions.dart'; 18 | part 'default_func.dart'; 19 | part 'function_base.dart'; 20 | part 'function_caller.dart'; 21 | part 'function_registry.dart'; 22 | part 'image_size_functions.dart'; 23 | part 'list_functions.dart'; 24 | part 'math_functions.dart'; 25 | part 'math_helper.dart'; 26 | part 'number_functions.dart'; 27 | part 'string_functions.dart'; 28 | part 'svg_functions.dart'; 29 | part 'types_functions.dart'; 30 | -------------------------------------------------------------------------------- /lib/src/functions/math_helper.dart: -------------------------------------------------------------------------------- 1 | // source: lib/less/functions/math-helper.js 2.5.1 20150720 2 | 3 | part of functions.less; 4 | 5 | /// 6 | class MathHelper { 7 | /// 8 | /// Applies Function [fn] to Node [n]. 9 | /// [unit] String ex: 'rad' 10 | /// 11 | //@defineMethodSkip 12 | static Dimension _math(Function fn, String unit, Node n) { 13 | if (n is! Dimension) { 14 | throw LessExceptionError( 15 | LessError(type: 'Argument', message: 'argument must be a number')); 16 | } 17 | 18 | Dimension node = n; 19 | Unit nodeUnit; 20 | 21 | if (unit == null) { 22 | nodeUnit = node.unit; 23 | } else { 24 | node = node.unify(); 25 | nodeUnit = Unit([unit]); 26 | } 27 | return Dimension(fn(node.value.toDouble()), nodeUnit); 28 | 29 | //2.5.1 20150720 30 | // MathHelper._math = function (fn, unit, n) { 31 | // if (!(n instanceof Dimension)) { 32 | // throw { type: "Argument", message: "argument must be a number" }; 33 | // } 34 | // if (unit == null) { 35 | // unit = n.unit; 36 | // } else { 37 | // n = n.unify(); 38 | // } 39 | // return new Dimension(fn(parseFloat(n.value)), unit); 40 | // }; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/src/index.dart: -------------------------------------------------------------------------------- 1 | library index.less; 2 | 3 | /// 4 | class LessIndex { 5 | /// 6 | static List version = [3, 10, 3]; 7 | } 8 | -------------------------------------------------------------------------------- /lib/src/plugins/less_plugin_advanced_color_functions/less_plugin_advanced_color_functions.dart: -------------------------------------------------------------------------------- 1 | library less_plugin_advanced_color_functions.plugins.less; 2 | 3 | import '../../tree/tree.dart'; 4 | import '../plugins.dart'; 5 | 6 | part 'advanced_color_functions.dart'; 7 | 8 | /// 9 | class LessPluginAdvancedColorFunctions extends Plugin { 10 | /// 11 | @override 12 | void install(PluginManager pluginManager) { 13 | pluginManager.addCustomFunctions(AdvancedColorFunctions()); 14 | } 15 | 16 | @override 17 | List minVersion = [2, 1, 0]; 18 | } 19 | -------------------------------------------------------------------------------- /lib/src/plugins/less_plugin_clean_css/clean_css_context.dart: -------------------------------------------------------------------------------- 1 | part of less_plugin_clean_css.plugins.less; 2 | 3 | /// 4 | /// CleanCss info to render the node 5 | /// 6 | class CleanCssContext { 7 | /// 8 | CleanCssCompatibility compatibility; 9 | 10 | /// 11 | bool keepBreaks = false; 12 | 13 | /// 14 | int precision; 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/plugins/plugins.dart: -------------------------------------------------------------------------------- 1 | library plugins.less; 2 | 3 | import '../environment/environment.dart'; 4 | import '../functions/functions.dart'; 5 | import '../index.dart'; 6 | import '../less_error.dart'; 7 | import '../less_options.dart'; 8 | import '../logger.dart'; 9 | import '../visitor/visitor_base.dart'; 10 | import 'less_plugin_advanced_color_functions/less_plugin_advanced_color_functions.dart'; 11 | import 'less_plugin_clean_css/less_plugin_clean_css.dart'; 12 | 13 | // ignore: directives_ordering 14 | export '../functions/functions.dart'; 15 | 16 | part 'plugin.dart'; 17 | part 'plugin_loader.dart'; 18 | part 'plugin_manager.dart'; 19 | part 'processor.dart'; 20 | -------------------------------------------------------------------------------- /lib/src/plugins/processor.dart: -------------------------------------------------------------------------------- 1 | part of plugins.less; 2 | 3 | /// 4 | /// Base class for plugin PreProcessors and PostProcessors 5 | /// 6 | class Processor { 7 | /// 8 | PluginOptions pluginOptions; 9 | 10 | /// 11 | Processor(this.pluginOptions); 12 | 13 | /// 14 | /// Do the work 15 | /// [input] contents to process 16 | /// [options] Map 17 | /// 18 | String process(String input, Map options) => input; 19 | } 20 | -------------------------------------------------------------------------------- /lib/src/render/render.dart: -------------------------------------------------------------------------------- 1 | //source: 2 | 3 | library render.less; 4 | 5 | import '../contexts.dart'; 6 | import '../environment/environment.dart'; 7 | import '../import_manager.dart'; 8 | import '../less_error.dart'; 9 | import '../less_options.dart'; 10 | import '../plugins/plugins.dart'; 11 | import '../sourcemap/sourcemap.dart'; 12 | import '../tree/tree.dart'; 13 | import '../visitor/visitor_base.dart'; 14 | 15 | part 'parse_tree.dart'; 16 | part 'transform_tree.dart'; 17 | -------------------------------------------------------------------------------- /lib/src/sourcemap/sourcemap.dart: -------------------------------------------------------------------------------- 1 | library sourcemap.less; 2 | 3 | import 'dart:convert'; 4 | 5 | import 'package:path/path.dart' as path_lib; 6 | import 'package:source_maps/source_maps.dart'; 7 | import 'package:source_span/source_span.dart'; 8 | 9 | import '../contexts.dart'; 10 | import '../environment/environment.dart'; 11 | import '../file_info.dart'; 12 | import '../import_manager.dart'; 13 | import '../less_options.dart'; 14 | import '../output.dart'; 15 | import '../tree/tree.dart'; 16 | 17 | part 'source_map_builder.dart'; 18 | part 'source_map_output.dart'; 19 | -------------------------------------------------------------------------------- /lib/src/tree/apply.dart: -------------------------------------------------------------------------------- 1 | //Not in original 2 | 3 | part of tree.less; 4 | 5 | /// 6 | /// @apply(--mixin-name); directive 7 | /// 8 | class Apply extends Node { 9 | @override 10 | final String name = null; 11 | 12 | @override 13 | final String type = 'Apply'; 14 | 15 | @override 16 | covariant Anonymous value; 17 | 18 | /// 19 | Apply(this.value, int index, FileInfo currentFileInfo) 20 | : super.init(currentFileInfo: currentFileInfo, index: index) { 21 | allowRoot = true; 22 | } 23 | 24 | /// Fields to show with genTree 25 | @override 26 | Map get treeField => {'value': value}; 27 | 28 | /// 29 | @override 30 | void genCSS(Contexts context, Output output) { 31 | output.add('@apply(', fileInfo: currentFileInfo, index: index); 32 | value.genCSS(context, output); 33 | output.add(');'); 34 | } 35 | 36 | @override 37 | String toString() { 38 | final output = Output(); 39 | genCSS(null, output); 40 | return output.toString(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/src/tree/keyword.dart: -------------------------------------------------------------------------------- 1 | //source: less/tree/keyword.js 2.5.0 2 | 3 | part of tree.less; 4 | 5 | /// 6 | class Keyword extends Node { 7 | @override 8 | final String type = 'Keyword'; 9 | 10 | @override 11 | covariant String value; 12 | 13 | /// 14 | Keyword(this.value); 15 | 16 | /// 17 | // ignore: non_constant_identifier_names 18 | Keyword.True() { 19 | value = 'true'; 20 | } 21 | 22 | /// 23 | // ignore: non_constant_identifier_names 24 | Keyword.False() { 25 | value = 'false'; 26 | } 27 | 28 | /// Fields to show with genTree 29 | @override 30 | Map get treeField => {'value': value}; 31 | 32 | /// 33 | @override 34 | void genCSS(Contexts context, Output output) { 35 | if (value == '%') { 36 | throw LessExceptionError( 37 | LessError(type: 'Syntax', message: 'Invalid % without number')); 38 | } 39 | output.add(value); 40 | 41 | //2.3.1 42 | // Keyword.prototype.genCSS = function (context, output) { 43 | // if (this.value === '%') { throw { type: "Syntax", message: "Invalid % without number" }; } 44 | // output.add(this.value); 45 | // }; 46 | } 47 | 48 | @override 49 | String toString() => value; 50 | } 51 | -------------------------------------------------------------------------------- /lib/src/tree/nodeset.dart: -------------------------------------------------------------------------------- 1 | part of tree.less; 2 | 3 | /// 4 | /// When a method returns List instead Node as required by the interface, 5 | /// Nodeset let encapsulate the List and return Node, as Nodeset.rules 6 | /// 7 | class Nodeset extends Node { 8 | @override 9 | final String type = 'Nodeset'; 10 | 11 | /// 12 | Nodeset(List rules) : super.init(rules: rules); 13 | 14 | /// 15 | /// add VisibilityBlock to each rule 16 | /// 17 | @override 18 | void addVisibilityBlock() { 19 | rules?.forEach((Node node) { 20 | node.addVisibilityBlock(); 21 | }); 22 | } 23 | 24 | /// 25 | /// Control test. Nodeset must be destroyed before this point 26 | /// 27 | @override 28 | void genCSS(Contexts context, Output output) { 29 | output.add('/* Nodeset error */'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/tree/paren.dart: -------------------------------------------------------------------------------- 1 | //source: less/tree/paren.js 2.5.0 2 | 3 | part of tree.less; 4 | 5 | /// 6 | class Paren extends Node { 7 | @override 8 | final String type = 'Paren'; 9 | 10 | @override 11 | covariant Node value; 12 | 13 | /// 14 | Paren(this.value); 15 | 16 | /// 17 | @override 18 | void genCSS(Contexts context, Output output) { 19 | output.add('('); 20 | value.genCSS(context, output); 21 | output.add(')'); 22 | 23 | //2.3.1 24 | // Paren.prototype.genCSS = function (context, output) { 25 | // output.add('('); 26 | // this.value.genCSS(context, output); 27 | // output.add(')'); 28 | // }; 29 | } 30 | 31 | /// Fields to show with genTree 32 | @override 33 | Map get treeField => {'value': value}; 34 | 35 | /// 36 | @override 37 | Paren eval(Contexts context) => Paren(value.eval(context)); 38 | 39 | //2.3.1 40 | // Paren.prototype.eval = function (context) { 41 | // return new Paren(this.value.eval(context)); 42 | // }; 43 | 44 | @override 45 | String toString() { 46 | final output = Output(); 47 | genCSS(null, output); 48 | return output.toString(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/src/tree/unicode_descriptor.dart: -------------------------------------------------------------------------------- 1 | //source: less/tree/unicode-descriptor.js 2.5.0 2 | 3 | part of tree.less; 4 | 5 | /// 6 | class UnicodeDescriptor extends Node { 7 | @override 8 | final String type = 'UnicodeDescriptor'; 9 | 10 | @override 11 | covariant String value; 12 | 13 | /// 14 | UnicodeDescriptor(this.value); 15 | 16 | /// Fields to show with genTree 17 | @override 18 | Map get treeField => {'value': value}; 19 | 20 | @override 21 | String toString() => value; 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/visitor/import_detector.dart: -------------------------------------------------------------------------------- 1 | part of visitor.less; 2 | 3 | /// 4 | /// Map used for recursionDetector and onceFileDetectionMap 5 | /// 6 | class ImportDetector { 7 | final Map _item = {}; 8 | 9 | /// Copy the [source] importDetector 10 | void addAll(ImportDetector source) => _item.addAll(source._item); 11 | 12 | /// 13 | bool containsKey(String key) => _item.containsKey(key); 14 | 15 | /// 16 | Iterable get keys => _item.keys; 17 | 18 | /// 19 | // ignore: avoid_positional_boolean_parameters 20 | void operator []=(String key, bool value) { 21 | _item[key] = value; 22 | } 23 | 24 | //--- static ---- 25 | 26 | /// 27 | /// Returns a new ImportDector copy of [source] 28 | /// 29 | static ImportDetector clone(ImportDetector source) { 30 | final result = ImportDetector(); 31 | return (source != null) ? (result..addAll(source)) : result; 32 | } 33 | 34 | /// 35 | /// Returns a not null [detector] 36 | /// 37 | static ImportDetector own(ImportDetector detector) => 38 | detector ?? ImportDetector(); 39 | } 40 | -------------------------------------------------------------------------------- /lib/src_builder/dot_less_builder.dart: -------------------------------------------------------------------------------- 1 | part of builder.less; 2 | 3 | /// 4 | /// Process .less files 5 | /// 6 | class DotLessBuilder extends BaseBuilder { 7 | @override 8 | Future transform(Function modifyOptions) { 9 | final task = Completer(); 10 | 11 | runZoned(() { 12 | final less = Less(); 13 | less.stdin.write(inputContent); 14 | less.transform(flags, modifyOptions: modifyOptions).then((int exitCode) { 15 | if (exitCode == 0) { 16 | outputContent = less.stdout.toString(); 17 | imports = less.imports; 18 | filesInPackage = less.filesInPackage; 19 | } else { 20 | isError = true; 21 | outputContent = errorMessage = less.stderr.toString(); 22 | } 23 | less.loggerReset(); 24 | task.complete(this); 25 | }); 26 | }, zoneValues: {#id: GenId.next}); 27 | 28 | return task.future; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: less_dart 2 | version: 2.3.8 3 | author: Adalberto Lacruz 4 | description: Native Dart Less compiler/builder to generate .css files from .less sources. 5 | homepage: https://github.com/AdalbertoLacruz/less_dart 6 | environment: 7 | sdk: '>=2.3.0 <3.0.0' 8 | dependencies: 9 | build: '>=1.0.0 <2.0.0' 10 | build_config: '>=0.3.1 <0.5.0' 11 | meta: '>=1.0.4 <2.0.0' 12 | mime: '>=0.9.0 <0.12.0' 13 | package_resolver: ">=1.0.2 <2.0.0" 14 | path: '>=1.4.1 <2.0.0' 15 | source_maps: '>=0.10.2 <0.12.0' 16 | source_span: '>=1.4.0 <2.0.0' 17 | utf: '>=0.9.0 <0.12.0' 18 | dev_dependencies: 19 | logging: '>=0.11.0 <0.12.0' 20 | mockito: '>=1.0.0 <5.0.0' 21 | stack_trace: '>=1.7.2 <2.0.0' 22 | test: '>=0.12.20+2 <2.0.0' 23 | -------------------------------------------------------------------------------- /test/banner.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Test 3 | */ -------------------------------------------------------------------------------- /test/benchmark/gen.less.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for i in {0..9999}; do 4 | echo ".x$i{color:green;}" 5 | done > big1.less -------------------------------------------------------------------------------- /test/benchmark/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | npm install less@2.5.0 3 | echo "Benchmark.less" 4 | echo "NodeJs" 5 | time nodejs ./node_modules/less/bin/lessc ./benchmark.less >/dev/null 6 | echo " ----------------- " 7 | echo "Dart" 8 | time dart ../../bin/lessc.dart ./benchmark.less >/dev/null 9 | echo " " 10 | echo "big1.less" 11 | echo "NodeJs" 12 | time nodejs ./node_modules/less/bin/lessc ./big1.less >/dev/null 13 | echo " ----------------- " 14 | echo "Dart" 15 | time dart ../../bin/lessc.dart ./big1.less >/dev/null 16 | 17 | -------------------------------------------------------------------------------- /test/cleancss/cleancss/colors-no.css: -------------------------------------------------------------------------------- 1 | #color{color:yellow;transparent:rgba(0,0,0,0);alpha:rgba(20,20,20,.56);hex6:#456789;hex3:#445566;coral:#ff7f50} -------------------------------------------------------------------------------- /test/cleancss/cleancss/main-ie7.css: -------------------------------------------------------------------------------- 1 | /*! clean-css optimization tests */#call{function:add(2,3)}#color{color:#ff0;transparent:rgba(0,0,0,0);alpha:rgba(20,20,20,.56);hex6:#456789;hex3:#456;coral:coral}#dimension{border:0;border:5px;transform:rotate(0);transform:rotate(45deg);margin:-.5em -1em;height:28.28px}/*! Directive remove empty block and comment */#expression{background:url(/images/icon-team.svg) 0 0/contain;-moz-transform:translate(0,11em) rotate(-90deg)}#fonts{font-weight:700;font-weight:400;font-weight:700;font:400 small/20px 'Trebuchet MS',Verdana,sans-serif;font:700 small}#important{height:20px!important}#rules{outline:0;outline:none solid 1px;background:0 0;background:0 0;background:rgba(0,0,0,0) no-repeat}#selectors input[type=text]{color:#fff}#selectors a[href^="http://"]{color:#000}#selectors p:not ([class*=lead]){color:#000}#selectors .div[data-id="1"]{color:red} -------------------------------------------------------------------------------- /test/cleancss/cleancss/main-ie8.css: -------------------------------------------------------------------------------- 1 | /*! clean-css optimization tests */#call{function:add(2,3)}#color{color:#ff0;transparent:rgba(0,0,0,0);alpha:rgba(20,20,20,.56);hex6:#456789;hex3:#456;coral:coral}#dimension{border:0;border:5px;transform:rotate(0);transform:rotate(45deg);margin:-.5em -1em;height:28.28px}/*! Directive remove empty block and comment */#expression{background:url(/images/icon-team.svg) 0 0/contain;-moz-transform:translate(0,11em) rotate(-90deg)}#fonts{font-weight:700;font-weight:400;font-weight:700;font:400 small/20px 'Trebuchet MS',Verdana,sans-serif;font:700 small}#important{height:20px!important}#rules{outline:0;outline:none solid 1px;background:0 0;background:0 0;background:rgba(0,0,0,0) no-repeat}#selectors input[type=text]{color:#fff}#selectors a[href^="http://"]{color:#000}#selectors p:not ([class*=lead]){color:#000}#selectors .div[data-id="1"]{color:red} -------------------------------------------------------------------------------- /test/cleancss/cleancss/main-skip-advanced.css: -------------------------------------------------------------------------------- 1 | /*! clean-css optimization tests */#call{function:add(2,3)}#color{color:#ff0;transparent:transparent;alpha:rgba(20,20,20,.56);hex6:#456789;hex3:#456;coral:coral}#dimension{border:0;border:5px;transform:rotate(0);transform:rotate(45deg);margin:-.5em -1em;height:28.28px}/*! Directive remove empty block and comment */#expression{background:url(/images/icon-team.svg)0 0/contain;-moz-transform:translate(0,11em)rotate(-90deg)}#fonts{font-weight:700;font-weight:400;font-weight:700;font:400 small/20px 'Trebuchet MS',Verdana,sans-serif;font:700 small}#important{height:20px!important}#rules{outline:0;outline:none solid 1px;background:0 0;background:0 0;background:transparent no-repeat}#selectors input[type=text]{color:#fff}#selectors a[href^="http://"]{color:#000}#selectors p:not ([class *= "lead"]){color:#000}#selectors .div[data-id="1"]{color:red} -------------------------------------------------------------------------------- /test/cleancss/cleancss/main.css: -------------------------------------------------------------------------------- 1 | /*! clean-css optimization tests */ 2 | #call{function:add(2,3)} 3 | #color{color:#ff0;transparent:transparent;alpha:rgba(20,20,20,.56);hex6:#456789;hex3:#456;coral:coral} 4 | #dimension{border:0;border:5px;transform:rotate(0);transform:rotate(45deg);margin:-.5em -1em;height:28.28px} 5 | #expression{background:url(/images/icon-team.svg)0 0/contain;-moz-transform:translate(0,11em)rotate(-90deg)} 6 | #fonts{font-weight:700;font-weight:400;font-weight:700;font:400 small/20px 'Trebuchet MS',Verdana,sans-serif;font:700 small} 7 | #important{height:20px!important} 8 | #rules{outline:0;outline:none solid 1px;background:0 0;background:0 0;background:transparent no-repeat} 9 | #selectors input[type=text]{color:#fff} 10 | #selectors a[href^="http://"]{color:#000} 11 | #selectors p:not ([class*=lead]){color:#000} 12 | #selectors .div[data-id="1"]{color:red} 13 | -------------------------------------------------------------------------------- /test/cleancss/css-clean.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8";div{color:#000}div{width:99%}*{min-width:45em}h1,h2>a>p,h3{color:none}div.class{color:blue}div#id{color:green}.class#id{color:purple}.one.two.three{color:grey}@media print{*{font-size:3em}}@media screen{*{font-size:10px}}@font-face{font-family:'Garamond Pro'}a:hover,a:link{color:#999}p,p:first-child{text-transform:none}q:lang(no){quotes:none}p+h1{font-size:2.2em}#shorthands{border:1px solid #000;font:12px/16px Arial;font:100%/16px Arial;margin:1px 0;padding:0 auto}#more-shorthands{margin:0;padding:1px 0 2px 0;font:400 small/20px 'Trebuchet MS',Verdana,sans-serif;font:0/0 a;border-radius:.5px}.misc{-moz-border-radius:2px;display:-moz-inline-stack;width:.1em;background-color:#009998;background:-webkit-gradient(linear,left top,left bottom,from(red),to(blue));margin:;filter:alpha(opacity=100);width:auto\9}.misc .nested-multiple{multiple-semi-colons:yes}#important{color:red!important;width:100%!important;height:20px!important}@font-face{font-family:font-a}@font-face{font-family:font-b}.æøå{margin:0} -------------------------------------------------------------------------------- /test/cleancss_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:less_dart/less.dart'; 3 | 4 | import 'package:test/test.dart'; 5 | 6 | void main() { 7 | test('Transform test/less/cleancss/main-ie8.less with --clean-css', () async { 8 | final less = Less(); 9 | final exitCode = await less.transform([ 10 | '--no-color', 11 | '--clean-css="compatibility=ie8"', 12 | 'test/less/cleancss/main-ie8.less', 13 | ]); 14 | if (exitCode != 0) { 15 | stderr.write(less.stderr.toString()); 16 | stdout.write(less.stdout.toString()); 17 | } 18 | expect(exitCode, 0); 19 | }); 20 | } 21 | -------------------------------------------------------------------------------- /test/css/calc.css: -------------------------------------------------------------------------------- 1 | .no-math { 2 | root: calc(100% - 30px); 3 | root2: calc(100% - 40px); 4 | width: calc(50% + (25vh - 20px)); 5 | height: calc(50% + (25vh - 20px)); 6 | min-height: calc(10vh + calc(5vh)); 7 | foo: 3 calc(3 + 4) 11; 8 | bar: calc(1 + 20%); 9 | } 10 | .b { 11 | one: calc(100% - 20px); 12 | two: calc(100% - (10px + 10px)); 13 | three: calc(100% - (3 * 1)); 14 | four: calc(100% - (3 * 1)); 15 | nested: calc(calc(2.25rem + 2px) - 1px * 2); 16 | } 17 | .c { 18 | height: calc(100% - ((10px * 3) + (10px * 2))); 19 | } 20 | -------------------------------------------------------------------------------- /test/css/charsets.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | -------------------------------------------------------------------------------- /test/css/comments2.css: -------------------------------------------------------------------------------- 1 | @-webkit-keyframes hover { 2 | /* Safari and Chrome */ 3 | } 4 | .bg { 5 | background-image: linear-gradient(#333 /*{comment}*/, #111); 6 | } 7 | #planadvisor, 8 | .first, 9 | .planning { 10 | margin: 10px; 11 | total-width: 96em; 12 | } 13 | .some-inline-comments { 14 | a: yes /* comment */; 15 | b: red /* comment */; 16 | c: yes /* comment */; 17 | d: red /* comment */; 18 | } 19 | -------------------------------------------------------------------------------- /test/css/compression/compression.css: -------------------------------------------------------------------------------- 1 | #colours{color1:#fea;color2:#ffeeaa;color3:rgba(255,238,170,0.1);string:"#fea";/*! but not this type 2 | Note preserved whitespace 3 | */}dimensions{val:.1px;val:0em;val:4cm;val:.2;val:5;angles-must-have-unit:0deg;durations-must-have-unit:0s;length-doesnt-have-unit:0px;width:auto\9}@page{marks:none;@top-left-corner{vertical-align:top}@top-left{vertical-align:top}}.shadow^.dom,body^^.shadow{display:done} -------------------------------------------------------------------------------- /test/css/css-escapes.css: -------------------------------------------------------------------------------- 1 | .escape\|random\|char { 2 | color: red; 3 | } 4 | .mixin\!tUp { 5 | font-weight: bold; 6 | } 7 | .\34 04 { 8 | background: red; 9 | } 10 | .\34 04 strong { 11 | color: fuchsia; 12 | font-weight: bold; 13 | } 14 | .trailingTest\+ { 15 | color: red; 16 | } 17 | /* This hideous test of hideousness checks for the selector "blockquote" with various permutations of hex escapes */ 18 | \62\6c\6f \63 \6B \0071 \000075o\74 e { 19 | color: silver; 20 | } 21 | [ng\:cloak], 22 | ng\:form { 23 | display: none; 24 | } 25 | .bootstrap { 26 | background-color: #000 \9; 27 | } 28 | textarea { 29 | font-family: 'helvetica neue', 'wenquanyi micro hei', \5FAE\8F6F\96C5\9ED1, \5B8B\4F53, sans-serif; 30 | } 31 | anything to unquote 32 | -------------------------------------------------------------------------------- /test/css/css-guards.css: -------------------------------------------------------------------------------- 1 | .light { 2 | color: green; 3 | } 4 | .see-the { 5 | color: green; 6 | } 7 | .hide-the { 8 | color: green; 9 | } 10 | .multiple-conditions-1 { 11 | color: red; 12 | } 13 | .inheritance .test { 14 | color: black; 15 | } 16 | .inheritance:hover { 17 | color: pink; 18 | } 19 | .clsWithGuard { 20 | dispaly: none; 21 | } 22 | .dont-split-me-up { 23 | width: 1px; 24 | color: red; 25 | height: 1px; 26 | } 27 | + .dont-split-me-up { 28 | sibling: true; 29 | } 30 | .scope-check { 31 | sub-prop: 2px; 32 | prop: 1px; 33 | } 34 | .scope-check-2 { 35 | sub-prop: 2px; 36 | prop: 1px; 37 | } 38 | -------------------------------------------------------------------------------- /test/css/debug/linenumbers-comments.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | /* line 1, {pathimport}test.less */ 3 | /* @charset "ISO-8859-1"; */ 4 | 5 | /* line 23, {pathimport}test.less */ 6 | .tst3 { 7 | color: grey; 8 | } 9 | /* line 15, {path}linenumbers.less */ 10 | .test1 { 11 | color: black; 12 | } 13 | /* line 6, {path}linenumbers.less */ 14 | .test2 { 15 | color: red; 16 | } 17 | @media all { 18 | /* line 5, {pathimport}test.less */ 19 | .tst { 20 | color: black; 21 | } 22 | } 23 | @media all and screen { 24 | /* line 7, {pathimport}test.less */ 25 | .tst { 26 | color: red; 27 | } 28 | /* line 9, {pathimport}test.less */ 29 | .tst .tst3 { 30 | color: white; 31 | } 32 | } 33 | /* line 18, {pathimport}test.less */ 34 | .tst2 { 35 | color: white; 36 | } 37 | /* line 27, {path}linenumbers.less */ 38 | .test { 39 | color: red; 40 | width: 2; 41 | } 42 | -------------------------------------------------------------------------------- /test/css/empty.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdalbertoLacruz/less_dart/9dd9fdd70d987ac4fdac6d788833e411da2cdeba/test/css/empty.css -------------------------------------------------------------------------------- /test/css/extend-chaining.css: -------------------------------------------------------------------------------- 1 | .a, 2 | .b, 3 | .c { 4 | color: black; 5 | } 6 | .f, 7 | .e, 8 | .d { 9 | color: black; 10 | } 11 | .g.h, 12 | .i.j.h, 13 | .k.j.h { 14 | color: black; 15 | } 16 | .i.j, 17 | .k.j { 18 | color: white; 19 | } 20 | .l, 21 | .m, 22 | .n, 23 | .o, 24 | .p, 25 | .q, 26 | .r, 27 | .s, 28 | .t { 29 | color: black; 30 | } 31 | .u, 32 | .v.u.v { 33 | color: black; 34 | } 35 | .w, 36 | .v.w.v { 37 | color: black; 38 | } 39 | .x, 40 | .y, 41 | .z { 42 | color: x; 43 | } 44 | .y, 45 | .z, 46 | .x { 47 | color: y; 48 | } 49 | .z, 50 | .x, 51 | .y { 52 | color: z; 53 | } 54 | .va, 55 | .vb, 56 | .vc { 57 | color: black; 58 | } 59 | .vb, 60 | .vc { 61 | color: white; 62 | } 63 | @media tv { 64 | .ma, 65 | .mb, 66 | .mc { 67 | color: black; 68 | } 69 | .md, 70 | .ma, 71 | .mb, 72 | .mc { 73 | color: white; 74 | } 75 | } 76 | @media tv and plasma { 77 | .me, 78 | .mf { 79 | background: red; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /test/css/extend-clearfix.css: -------------------------------------------------------------------------------- 1 | .clearfix, 2 | .foo, 3 | .bar { 4 | *zoom: 1; 5 | } 6 | .clearfix:after, 7 | .foo:after, 8 | .bar:after { 9 | content: ''; 10 | display: block; 11 | clear: both; 12 | height: 0; 13 | } 14 | .foo { 15 | color: red; 16 | } 17 | .bar { 18 | color: blue; 19 | } 20 | -------------------------------------------------------------------------------- /test/css/extend-exact.css: -------------------------------------------------------------------------------- 1 | .replace.replace .replace, 2 | .c.replace + .replace .replace, 3 | .replace.replace .c, 4 | .c.replace + .replace .c, 5 | .rep_ace { 6 | prop: copy-paste-replace; 7 | } 8 | .a .b .c { 9 | prop: not_effected; 10 | } 11 | .a, 12 | .effected { 13 | prop: is_effected; 14 | } 15 | .a .b { 16 | prop: not_effected; 17 | } 18 | .a .b.c { 19 | prop: not_effected; 20 | } 21 | .c .b .a, 22 | .a .b .a, 23 | .c .a .a, 24 | .a .a .a, 25 | .c .b .c, 26 | .a .b .c, 27 | .c .a .c, 28 | .a .a .c { 29 | prop: not_effected; 30 | } 31 | .e.e, 32 | .dbl { 33 | prop: extend-double; 34 | } 35 | .e.e:hover { 36 | hover: not-extended; 37 | } 38 | -------------------------------------------------------------------------------- /test/css/extend-media.css: -------------------------------------------------------------------------------- 1 | .ext1 .ext2, 2 | .all .ext2 { 3 | background: black; 4 | } 5 | @media tv { 6 | .ext1 .ext3, 7 | .tv-lowres .ext3, 8 | .all .ext3 { 9 | color: white; 10 | } 11 | .tv-lowres { 12 | background: blue; 13 | } 14 | } 15 | @media tv and hires { 16 | .ext1 .ext4, 17 | .tv-hires .ext4, 18 | .all .ext4 { 19 | color: green; 20 | } 21 | .tv-hires { 22 | background: red; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/css/extend.css: -------------------------------------------------------------------------------- 1 | .error, 2 | .badError { 3 | border: 1px #f00; 4 | background: #fdd; 5 | } 6 | .error.intrusion, 7 | .badError.intrusion { 8 | font-size: 1.3em; 9 | font-weight: bold; 10 | } 11 | .intrusion .error, 12 | .intrusion .badError { 13 | display: none; 14 | } 15 | .badError { 16 | border-width: 3px; 17 | } 18 | .foo .bar, 19 | .foo .baz, 20 | .ext1 .ext2 .bar, 21 | .ext1 .ext2 .baz, 22 | .ext3 .bar, 23 | .ext3 .baz, 24 | .foo .ext3, 25 | .ext4 .bar, 26 | .ext4 .baz, 27 | .foo .ext4 { 28 | display: none; 29 | } 30 | div.ext5, 31 | .ext6 > .ext5, 32 | div.ext7, 33 | .ext6 > .ext7 { 34 | width: 100px; 35 | } 36 | .ext8.ext9, 37 | .fuu { 38 | result: add-foo; 39 | } 40 | .ext8 .ext9, 41 | .ext8 + .ext9, 42 | .ext8 > .ext9, 43 | .buu, 44 | .zap, 45 | .zoo { 46 | result: bar-matched; 47 | } 48 | .ext8.nomatch { 49 | result: none; 50 | } 51 | .ext8 .ext9, 52 | .buu { 53 | result: match-nested-bar; 54 | } 55 | .ext8.ext9, 56 | .fuu { 57 | result: match-nested-foo; 58 | } 59 | .aa, 60 | .cc { 61 | color: black; 62 | } 63 | .aa .dd, 64 | .aa .ee { 65 | background: red; 66 | } 67 | .bb, 68 | .cc, 69 | .ee, 70 | .ff { 71 | background: red; 72 | } 73 | .bb .bb, 74 | .ff .ff { 75 | color: black; 76 | } 77 | -------------------------------------------------------------------------------- /test/css/extendedTest/apply.css: -------------------------------------------------------------------------------- 1 | --polymer-mixin: { 2 | background-color: red; 3 | } 4 | body { 5 | --foo: green; 6 | color: var(--foo, red); 7 | background-color: blue; 8 | @apply(--polymer-mixin); 9 | } 10 | -------------------------------------------------------------------------------- /test/css/extendedTest/colors.css: -------------------------------------------------------------------------------- 1 | #rgba { 2 | color: rgba(255, 255, 170, 0.56444444); 3 | } 4 | #rrggbbaa { 5 | color: rgba(255, 255, 170, 0.56444444); 6 | } 7 | #hsv { 8 | value1: 100%; 9 | value2: 100%; 10 | value3: 100%; 11 | } 12 | -------------------------------------------------------------------------------- /test/css/extendedTest/function-rem.css: -------------------------------------------------------------------------------- 1 | h2 { 2 | font-size: 2rem; 3 | } 4 | h3 { 5 | font-size: 1rem; 6 | margin: 1rem; 7 | padding: 1rem; 8 | } 9 | h4 { 10 | font-size: 2rem; 11 | } 12 | header { 13 | padding: 1.25rem 0; 14 | font-size: 1rem; 15 | } 16 | -------------------------------------------------------------------------------- /test/css/extendedTest/image-size.css: -------------------------------------------------------------------------------- 1 | #file-size-functions { 2 | bmp-size: 123px 456px; 3 | gif-size: 123px 456px; 4 | jpg-size: 123px 456px; 5 | png-size: 123px 456px; 6 | psd-size: 123px 456px; 7 | svg-size: 123px 456px; 8 | webp-size1: 123px 456px; 9 | webp-size2: 123px 456px; 10 | } 11 | -------------------------------------------------------------------------------- /test/css/extendedTest/import-complex-path.css: -------------------------------------------------------------------------------- 1 | #import { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /test/css/extendedTest/import-package-lib.css: -------------------------------------------------------------------------------- 1 | @charset "ISO-8859-1"; 2 | -------------------------------------------------------------------------------- /test/css/extendedTest/import-package.css: -------------------------------------------------------------------------------- 1 | @charset "ISO-8859-1"; 2 | -------------------------------------------------------------------------------- /test/css/extendedTest/options-import.css: -------------------------------------------------------------------------------- 1 | .parens { 2 | border: 2px solid black; 3 | margin: 1px 3px 16 3; 4 | width: 36; 5 | padding: 2px 36px; 6 | } 7 | .more-parens { 8 | padding: 8 4 4 4px; 9 | width-all: 96; 10 | width-first: 16 * 6; 11 | width-keep: (4 * 4) * 6; 12 | height-keep: (7 * 7) + (8 * 8); 13 | height-all: 113; 14 | height-parts: 49 + 64; 15 | margin-keep: (4 * (5 + 5) / 2) - (4 * 2); 16 | margin-parts: 20 - 8; 17 | margin-all: 12; 18 | border-radius-keep: 4px * (1 + 1) / 4 + 3px; 19 | border-radius-parts: 8px / 7px; 20 | border-radius-all: 5px; 21 | } 22 | .negative { 23 | neg-var: -1; 24 | neg-var-paren: -1; 25 | } 26 | .nested-parens { 27 | width: 2 * (4 * (2 + (1 + 6))) - 1; 28 | height: ((2 + 3) * (2 + 3) / (9 - 4)) + 1; 29 | } 30 | .mixed-units { 31 | margin: 2px 4em 1 5pc; 32 | padding: 6px 1em 2px 2; 33 | } 34 | .test-false-negatives { 35 | a: (; 36 | } 37 | -------------------------------------------------------------------------------- /test/css/extendedTest/options-plugin.css: -------------------------------------------------------------------------------- 1 | .a { 2 | invertluma: #ff0000; 3 | contrastmore: #000000; 4 | autocontrast: #ffa500; 5 | } 6 | -------------------------------------------------------------------------------- /test/css/extendedTest/options-strict-math.css: -------------------------------------------------------------------------------- 1 | .parens { 2 | border: 2px solid black; 3 | margin: 1px 3px 16 3; 4 | width: 36; 5 | padding: 2px 36px; 6 | } 7 | .more-parens { 8 | padding: 8 4 4 4px; 9 | width-all: 96; 10 | width-first: 16 * 6; 11 | width-keep: (4 * 4) * 6; 12 | height-keep: (7 * 7) + (8 * 8); 13 | height-all: 113; 14 | height-parts: 49 + 64; 15 | margin-keep: (4 * (5 + 5) / 2) - (4 * 2); 16 | margin-parts: 20 - 8; 17 | margin-all: 12; 18 | border-radius-keep: 4px * (1 + 1) / 4 + 3px; 19 | border-radius-parts: 8px / 7px; 20 | border-radius-all: 5px; 21 | } 22 | .negative { 23 | neg-var: -1; 24 | neg-var-paren: -1; 25 | } 26 | .nested-parens { 27 | width: 2 * (4 * (2 + (1 + 6))) - 1; 28 | height: ((2 + 3) * (2 + 3) / (9 - 4)) + 1; 29 | } 30 | .mixed-units { 31 | margin: 2px 4em 1 5pc; 32 | padding: 6px 1em 2px 2; 33 | } 34 | .test-false-negatives { 35 | a: (; 36 | } 37 | -------------------------------------------------------------------------------- /test/css/extendedTest/plugin-advanced-color.css: -------------------------------------------------------------------------------- 1 | .a { 2 | invertluma: #ff0000; 3 | contrastmore: #000000; 4 | autocontrast: #ffa500; 5 | } 6 | -------------------------------------------------------------------------------- /test/css/extendedTest/url.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Montserrat'; 3 | font-style: normal; 4 | font-weight: 400; 5 | src: local('Montserrat Regular'), local('Montserrat-Regular'), url(https://fonts.gstatic.com/s/montserrat/v14/JTUSjIg1_i6t8kCHKm459Wlhzg.ttf) format('truetype'); 6 | } 7 | @font-face { 8 | font-family: 'Montserrat'; 9 | font-style: normal; 10 | font-weight: 700; 11 | src: local('Montserrat Bold'), local('Montserrat-Bold'), url(https://fonts.gstatic.com/s/montserrat/v14/JTURjIg1_i6t8kCHKm45_dJE3gnD-w.ttf) format('truetype'); 12 | } 13 | @font-face { 14 | font-family: 'Open Sans'; 15 | font-style: normal; 16 | font-weight: 400; 17 | src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v17/mem8YaGs126MiZpBA-UFVZ0e.ttf) format('truetype'); 18 | } 19 | @font-face { 20 | font-family: 'Open Sans'; 21 | font-style: normal; 22 | font-weight: 700; 23 | src: local('Open Sans Bold'), local('OpenSans-Bold'), url(https://fonts.gstatic.com/s/opensans/v17/mem5YaGs126MiZpBA-UN7rgOUuhs.ttf) format('truetype'); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /test/css/filemanagerPlugin/filemanager.css: -------------------------------------------------------------------------------- 1 | .test { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /test/css/globalVars/extended.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Test 3 | */ 4 | #header { 5 | color: #333333; 6 | border-left: 1px; 7 | border-right: 2px; 8 | } 9 | #footer { 10 | color: #114411; 11 | border-color: #f20d0d; 12 | } 13 | -------------------------------------------------------------------------------- /test/css/globalVars/simple.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Test 3 | */ 4 | .class { 5 | color: red; 6 | } 7 | -------------------------------------------------------------------------------- /test/css/ie-filters.css: -------------------------------------------------------------------------------- 1 | .nav { 2 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=20); 3 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0); 4 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#333333", endColorstr="#000000", GradientType=0); 5 | } 6 | .evalTest1 { 7 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=30); 8 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=5); 9 | } 10 | -------------------------------------------------------------------------------- /test/css/import-absolute-path.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | -------------------------------------------------------------------------------- /test/css/import-inline.css: -------------------------------------------------------------------------------- 1 | #import { 2 | color: red; 3 | } 4 | @media (min-width: 600px) { 5 | #css { color: yellow; } 6 | 7 | } 8 | this isn't very valid CSS. 9 | -------------------------------------------------------------------------------- /test/css/import-interpolation.css: -------------------------------------------------------------------------------- 1 | body { 2 | width: 100%; 3 | } 4 | #logo { 5 | width: 100px; 6 | height: 100px; 7 | background: url('../assets/logo.png'); 8 | background: url("#inline-svg"); 9 | } 10 | 11 | .a { 12 | var: test; 13 | } 14 | -------------------------------------------------------------------------------- /test/css/import-once.css: -------------------------------------------------------------------------------- 1 | #import { 2 | color: red; 3 | } 4 | body { 5 | width: 100%; 6 | } 7 | .test-f { 8 | height: 10px; 9 | } 10 | body { 11 | width: 100%; 12 | } 13 | .test-f { 14 | height: 10px; 15 | } 16 | -------------------------------------------------------------------------------- /test/css/import-reference-issues.css: -------------------------------------------------------------------------------- 1 | .test-c { 2 | background-color: green; 3 | } 4 | .theOnlySelector { 5 | shall-have: one selector; 6 | } 7 | show-all-content { 8 | /* 9 | tralala 10 | */ 11 | } 12 | show-all-content .fix { 13 | fix: fix; 14 | } 15 | show-all-content .something { 16 | inside: something; 17 | } 18 | #used-namespaced-mixin { 19 | was: included; 20 | shall-see: another property above; 21 | } 22 | call-mixin-with-import-by-reference-inside { 23 | the-only-property: nothing-below-this; 24 | } 25 | -------------------------------------------------------------------------------- /test/css/import.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | /** comment at the top**/ 3 | @import url(/absolute/something.css) screen and (color) and (max-width: 600px); 4 | @import url("//ha.com/file.css") (min-width: 100px); 5 | #import-test { 6 | height: 10px; 7 | color: red; 8 | width: 10px; 9 | height: 30%; 10 | } 11 | @media screen and (max-width: 600px) { 12 | body { 13 | width: 100%; 14 | } 15 | } 16 | #import { 17 | color: red; 18 | } 19 | .mixin { 20 | height: 10px; 21 | color: red; 22 | } 23 | .test-f { 24 | height: 10px; 25 | } 26 | .deep-import-url { 27 | color: red; 28 | } 29 | @media screen and (max-width: 601px) { 30 | #css { 31 | color: yellow; 32 | } 33 | } 34 | @media screen and (max-width: 602px) { 35 | body { 36 | width: 100%; 37 | } 38 | } 39 | @media screen and (max-width: 603px) { 40 | #css { 41 | color: yellow; 42 | } 43 | } 44 | @media print { 45 | body { 46 | width: 100%; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /test/css/include-path-string/include-path-string.css: -------------------------------------------------------------------------------- 1 | data-uri { 2 | property: url("data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%0A%3Csvg%20height%3D%22100%22%20width%3D%22100%22%3E%0A%20%20%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2240%22%20stroke%3D%22black%22%20stroke-width%3D%221%22%20fill%3D%22blue%22%20%2F%3E%0A%3C%2Fsvg%3E%0A"); 3 | } 4 | -------------------------------------------------------------------------------- /test/css/include-path/include-path.css: -------------------------------------------------------------------------------- 1 | body { 2 | width: 100%; 3 | } 4 | data-uri { 5 | property: url("data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%0A%3Csvg%20height%3D%22100%22%20width%3D%22100%22%3E%0A%20%20%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2240%22%20stroke%3D%22black%22%20stroke-width%3D%221%22%20fill%3D%22blue%22%20%2F%3E%0A%3C%2Fsvg%3E%0A"); 6 | } 7 | image-size { 8 | property: 100px 100px; 9 | } 10 | -------------------------------------------------------------------------------- /test/css/javascript.css: -------------------------------------------------------------------------------- 1 | .eval { 2 | js: 42; 3 | js: 2; 4 | js: "hello world"; 5 | js: 1, 2, 3; 6 | title: "string"; 7 | ternary: true; 8 | multiline: 2; 9 | } 10 | .scope { 11 | empty: ; 12 | var: 42; 13 | escaped: 7px; 14 | } 15 | .vars { 16 | width: 8; 17 | } 18 | .escape-interpol { 19 | width: hello world; 20 | } 21 | .arrays { 22 | ary: "1, 2, 3"; 23 | ary1: "1, 2, 3"; 24 | } 25 | .test-tran { 26 | 1: opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear; 27 | 2: [opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear]; 28 | 3: opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear; 29 | } 30 | -------------------------------------------------------------------------------- /test/css/lazy-eval.css: -------------------------------------------------------------------------------- 1 | .lazy-eval { 2 | width: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /test/css/legacy/legacy.css: -------------------------------------------------------------------------------- 1 | @media (-o-min-device-pixel-ratio: 2) { 2 | .test-math-and-units { 3 | font: ignores 0/0 rules; 4 | test-division: 7em; 5 | simple: 2px; 6 | } 7 | } 8 | #units { 9 | t1: 22em; 10 | t2: 22em; 11 | t3: 2em; 12 | t4: 22em; 13 | t5: 22em; 14 | t6: 2em; 15 | t7: 22em; 16 | t8: 22em; 17 | t9: 2em; 18 | t10: 22em; 19 | t11: 22em; 20 | t12: 2em; 21 | } 22 | -------------------------------------------------------------------------------- /test/css/math/parens-division/media-math.css: -------------------------------------------------------------------------------- 1 | @media (min-width: 17) { 2 | .foo { 3 | bar: 1; 4 | } 5 | } 6 | @media (min-width: 16 / 9) { 7 | .foo { 8 | bar: 1; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/css/math/parens-division/new-division.css: -------------------------------------------------------------------------------- 1 | .units { 2 | font: 1.2rem/2rem; 3 | font: 8vw/9vw; 4 | font: 10vh/12vh; 5 | font: 12vm/15vm; 6 | font: 12vmin/15vmin; 7 | font: 1.2ch/1.5ch; 8 | } 9 | .math { 10 | a: 2; 11 | b: 2px / 2; 12 | c: 1px; 13 | d: 1px; 14 | e: 4px / 2; 15 | f: 2px; 16 | } 17 | -------------------------------------------------------------------------------- /test/css/math/parens-division/parens.css: -------------------------------------------------------------------------------- 1 | .parens { 2 | border: 2px solid black; 3 | margin: 1px 3px 16 3; 4 | width: 36; 5 | padding: 2px 36px; 6 | } 7 | .more-parens { 8 | padding: 8 4 4 4px; 9 | width-all: 96; 10 | width-first: 96; 11 | width-keep: 96; 12 | height: calc(100% + (25vh - 20px)); 13 | height-keep: 113; 14 | height-all: 113; 15 | height-parts: 113; 16 | margin-keep: 12; 17 | margin-parts: 12; 18 | margin-all: 12; 19 | border-radius-keep: 8px / 4 + 3px; 20 | border-radius-parts: 8px / 7px; 21 | border-radius-all: 5px; 22 | } 23 | .negative { 24 | neg-var: -1; 25 | neg-var-paren: -1; 26 | } 27 | .nested-parens { 28 | width: 71; 29 | height: 6; 30 | } 31 | .mixed-units { 32 | margin: 2px 4em 1 5pc; 33 | padding: 6px 1em 2px 2; 34 | } 35 | .test-false-negatives { 36 | a: (; 37 | } 38 | -------------------------------------------------------------------------------- /test/css/math/strict-legacy/media-math.css: -------------------------------------------------------------------------------- 1 | @media (min-width: 16 + 1) { 2 | .foo { 3 | bar: 1; 4 | } 5 | } 6 | @media (min-width: 16 / 9) { 7 | .foo { 8 | bar: 1; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/css/math/strict-legacy/parens.css: -------------------------------------------------------------------------------- 1 | .parens { 2 | border: 2px solid black; 3 | margin: 1px 3px 16 3; 4 | width: 36; 5 | padding: 2px 36px; 6 | } 7 | .in-function { 8 | value: 2 + 1; 9 | } 10 | .more-parens { 11 | padding: 8 4 4 4px; 12 | width-all: 96; 13 | width-first: 16 * 6; 14 | width-keep: (4 * 4) * 6; 15 | height: calc(100% + (25vh - 20px)); 16 | height-keep: (7 * 7) + (8 * 8); 17 | height-all: 113; 18 | height-parts: 49 + 64; 19 | margin-keep: (4 * (5 + 5) / 2) - (4 * 2); 20 | margin-parts: 20 - 8; 21 | margin-all: 12; 22 | border-radius-keep: 4px * (1 + 1) / 4 + 3px; 23 | border-radius-parts: 8px / 7px; 24 | border-radius-all: 5px; 25 | } 26 | .negative { 27 | neg-var: -1; 28 | neg-var-paren: -1; 29 | } 30 | .nested-parens { 31 | width: 2 * (4 * (2 + (1 + 6))) - 1; 32 | height: ((2 + 3) * (2 + 3) / (9 - 4)) + 1; 33 | } 34 | .mixed-units { 35 | margin: 2px 4em 1 5pc; 36 | padding: 6px 1em 2px 2; 37 | } 38 | .test-false-negatives { 39 | a: (; 40 | } 41 | -------------------------------------------------------------------------------- /test/css/math/strict/media-math.css: -------------------------------------------------------------------------------- 1 | @media (min-width: 16 + 1) { 2 | .foo { 3 | bar: 1; 4 | } 5 | } 6 | @media (min-width: 16 / 9) { 7 | .foo { 8 | bar: 1; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/css/math/strict/parens.css: -------------------------------------------------------------------------------- 1 | .parens { 2 | border: 2px solid black; 3 | margin: 1px 3px 16 3; 4 | width: 36; 5 | padding: 2px 36px; 6 | } 7 | .more-parens { 8 | padding: 8 4 4 4px; 9 | width-all: 96; 10 | width-first: 16 * 6; 11 | width-keep: 16 * 6; 12 | height: calc(100% + (25vh - 20px)); 13 | height-keep: 49 + 64; 14 | height-all: 113; 15 | height-parts: 49 + 64; 16 | margin-keep: 20 - 8; 17 | margin-parts: 20 - 8; 18 | margin-all: 12; 19 | border-radius-keep: 4px * 2 / 4 + 3px; 20 | border-radius-parts: 8px / 7px; 21 | border-radius-all: 5px; 22 | } 23 | .negative { 24 | neg-var: -1; 25 | neg-var-paren: -1; 26 | } 27 | .nested-parens { 28 | width: 2 * 36 - 1; 29 | height: 5 + 1; 30 | } 31 | .mixed-units { 32 | margin: 2px 4em 1 5pc; 33 | padding: 6px 1em 2px 2; 34 | } 35 | .test-false-negatives { 36 | a: (; 37 | } 38 | -------------------------------------------------------------------------------- /test/css/merge.css: -------------------------------------------------------------------------------- 1 | .test1 { 2 | transform: rotate(90deg), skew(30deg), scale(2, 4); 3 | } 4 | .test2 { 5 | transform: rotate(90deg), skew(30deg); 6 | transform: scaleX(45deg); 7 | } 8 | .test3 { 9 | transform: scaleX(45deg); 10 | background: url(data://img1.png); 11 | } 12 | .test4 { 13 | transform: rotate(90deg), skew(30deg), scale(2, 4) !important; 14 | } 15 | .test5 { 16 | transform: rotate(90deg), skew(30deg), scale(2, 4) !important; 17 | } 18 | .test6 { 19 | transform: scale(2, 4); 20 | } 21 | .test7 { 22 | transform: scale(2, 4), scale(2, 4), scale(2, 4) !important; 23 | } 24 | .test-interleaved { 25 | transform: t1, t2, t3; 26 | background: b1, b2, b3; 27 | } 28 | .test-spaced { 29 | transform: t1 t2 t3; 30 | background: b1 b2, b3; 31 | } 32 | .test-interleaved-with-spaced { 33 | transform: t1s, t2 t3s, t4 t5s t6s; 34 | background: b1 b2s, b3, b4; 35 | } 36 | -------------------------------------------------------------------------------- /test/css/mixins-closure.css: -------------------------------------------------------------------------------- 1 | .class { 2 | width: 99px; 3 | } 4 | .overwrite { 5 | width: 99px; 6 | } 7 | .nested .class { 8 | width: 5px; 9 | } 10 | -------------------------------------------------------------------------------- /test/css/mixins-important.css: -------------------------------------------------------------------------------- 1 | .class { 2 | border: 1; 3 | boxer: 1; 4 | border-width: 1; 5 | border: 2 !important; 6 | boxer: 2 !important; 7 | border-width: 2 !important; 8 | border: 3; 9 | boxer: 3; 10 | border-width: 3; 11 | border: 4 !important; 12 | boxer: 4 !important; 13 | border-width: 4 !important; 14 | border: 5; 15 | boxer: 5; 16 | border-width: 5; 17 | border: 0 !important; 18 | boxer: 0 !important; 19 | border-width: 0 !important; 20 | border: 9 !important; 21 | border: 9; 22 | boxer: 9; 23 | border-width: 9; 24 | } 25 | .class .inner { 26 | test: 1; 27 | } 28 | .class .inner { 29 | test: 2 !important; 30 | } 31 | .class .inner { 32 | test: 3; 33 | } 34 | .class .inner { 35 | test: 4 !important; 36 | } 37 | .class .inner { 38 | test: 5; 39 | } 40 | .class .inner { 41 | test: 0 !important; 42 | } 43 | .class .inner { 44 | test: 9; 45 | } 46 | .when-calling-nested-issue-2394 { 47 | width: auto !important; 48 | } 49 | .when-calling-nested-with-param-issue-2394 { 50 | width: 10px !important; 51 | } 52 | .class1-2421 { 53 | margin: 5px !important; 54 | } 55 | .class2-2421 { 56 | margin: 5px; 57 | } 58 | -------------------------------------------------------------------------------- /test/css/mixins-interpolated.css: -------------------------------------------------------------------------------- 1 | .123 { 2 | a: 0; 3 | } 4 | .foo { 5 | a: 1; 6 | } 7 | .foo { 8 | a: 2; 9 | } 10 | #foo { 11 | a: 3; 12 | } 13 | #foo { 14 | a: 4; 15 | } 16 | mi-test-a { 17 | a: 0; 18 | a: 1; 19 | a: 2; 20 | a: 3; 21 | a: 4; 22 | } 23 | .b .bb.foo-xxx .yyy-foo#foo .foo.bbb { 24 | b: 1; 25 | } 26 | mi-test-b { 27 | b: 1; 28 | } 29 | #foo-foo > .bar .baz { 30 | c: c; 31 | } 32 | mi-test-c-1 > .bar .baz { 33 | c: c; 34 | } 35 | mi-test-c-2 .baz { 36 | c: c; 37 | } 38 | mi-test-c-3 { 39 | c: c; 40 | } 41 | mi-test-d { 42 | gender: "Male"; 43 | } 44 | -------------------------------------------------------------------------------- /test/css/mixins-named-args.css: -------------------------------------------------------------------------------- 1 | .named-arg { 2 | color: blue; 3 | width: 5px; 4 | height: 99%; 5 | args: 1px 100%; 6 | text-align: center; 7 | } 8 | .class { 9 | width: 5px; 10 | height: 19%; 11 | args: 1px 20%; 12 | } 13 | .all-args-wrong-args { 14 | width: 10px; 15 | height: 9%; 16 | args: 2px 10%; 17 | } 18 | .named-args2 { 19 | width: 15px; 20 | height: 49%; 21 | color: #646464; 22 | } 23 | .named-args3 { 24 | width: 5px; 25 | height: 29%; 26 | color: #123456; 27 | } 28 | -------------------------------------------------------------------------------- /test/css/mixins-nested.css: -------------------------------------------------------------------------------- 1 | .class .inner { 2 | height: 300; 3 | } 4 | .class .inner .innest { 5 | width: 30; 6 | border-width: 60; 7 | } 8 | .class2 .inner { 9 | height: 600; 10 | } 11 | .class2 .inner .innest { 12 | width: 60; 13 | border-width: 120; 14 | } 15 | -------------------------------------------------------------------------------- /test/css/mixins-pattern.css: -------------------------------------------------------------------------------- 1 | .zero { 2 | variadic: true; 3 | named-variadic: true; 4 | zero: 0; 5 | one: 1; 6 | two: 2; 7 | three: 3; 8 | } 9 | .one { 10 | variadic: true; 11 | named-variadic: true; 12 | one: 1; 13 | one-req: 1; 14 | two: 2; 15 | three: 3; 16 | } 17 | .two { 18 | variadic: true; 19 | named-variadic: true; 20 | two: 2; 21 | three: 3; 22 | } 23 | .three { 24 | variadic: true; 25 | named-variadic: true; 26 | three-req: 3; 27 | three: 3; 28 | } 29 | .left { 30 | left: 1; 31 | } 32 | .right { 33 | right: 1; 34 | } 35 | .border-right { 36 | color: black; 37 | border-right: 4px; 38 | } 39 | .border-left { 40 | color: black; 41 | border-left: 4px; 42 | } 43 | .only-right { 44 | right: 33; 45 | } 46 | .only-left { 47 | left: 33; 48 | } 49 | .left-right { 50 | both: 330; 51 | } 52 | -------------------------------------------------------------------------------- /test/css/modifyVars/extended.css: -------------------------------------------------------------------------------- 1 | #header { 2 | color: #333333; 3 | border-left: 1px; 4 | border-right: 2px; 5 | } 6 | #footer { 7 | color: #114411; 8 | border-color: #842210; 9 | } 10 | -------------------------------------------------------------------------------- /test/css/namespacing/namespacing-1.css: -------------------------------------------------------------------------------- 1 | .foo { 2 | color1: red; 3 | color2: yellow; 4 | color3: red; 5 | color4: yellow; 6 | color5: red; 7 | prop: uno; 8 | var: dos; 9 | sub: tres; 10 | } 11 | #ns1 { 12 | foo: bar; 13 | } 14 | #ns1 { 15 | foo: uno; 16 | } 17 | .button { 18 | color: grey; 19 | border-color: #AAA #CCC; 20 | } 21 | -------------------------------------------------------------------------------- /test/css/namespacing/namespacing-2.css: -------------------------------------------------------------------------------- 1 | .bar { 2 | width: 800px; 3 | height: 2px; 4 | } 5 | .foo { 6 | width: 800px; 7 | } 8 | .lunch { 9 | treat: ice cream; 10 | } 11 | -------------------------------------------------------------------------------- /test/css/namespacing/namespacing-3.css: -------------------------------------------------------------------------------- 1 | @media (min-width: 320px) { 2 | .toolbar { 3 | width: 400px; 4 | height: 200px; 5 | background: red; 6 | color: white; 7 | } 8 | } 9 | .cell { 10 | margin: 0 5px !important; 11 | } 12 | .class1 { 13 | color: #33acfe !important; 14 | margin: 20px !important; 15 | padding: 20px !important; 16 | width: 0 !important; 17 | } 18 | .class2 { 19 | color: #efca44; 20 | margin: 10px; 21 | padding: 40px 10px; 22 | width: 0 !important; 23 | } 24 | -------------------------------------------------------------------------------- /test/css/namespacing/namespacing-4.css: -------------------------------------------------------------------------------- 1 | .foo { 2 | width: 20px; 3 | background: rebeccapurple; 4 | color: white; 5 | } 6 | -------------------------------------------------------------------------------- /test/css/namespacing/namespacing-5.css: -------------------------------------------------------------------------------- 1 | .my-navbar { 2 | background: rebeccapurple; 3 | val: output; 4 | } 5 | .another-navbar { 6 | background: rebeccapurple !important; 7 | border: 1px solid lightblue !important; 8 | } 9 | .another { 10 | background: black; 11 | border: 1px solid grey; 12 | } 13 | -------------------------------------------------------------------------------- /test/css/namespacing/namespacing-6.css: -------------------------------------------------------------------------------- 1 | .rule-1 { 2 | width: 10px; 3 | } 4 | .rule-2 { 5 | width: 10px; 6 | } 7 | .rule-3 { 8 | width: 10px; 9 | height: 10px; 10 | } 11 | -------------------------------------------------------------------------------- /test/css/namespacing/namespacing-7.css: -------------------------------------------------------------------------------- 1 | .output { 2 | a: b; 3 | } 4 | .output-2 { 5 | c: d; 6 | } 7 | .dr { 8 | a: b; 9 | } 10 | .dr-2 { 11 | c: d; 12 | } 13 | -------------------------------------------------------------------------------- /test/css/namespacing/namespacing-functions.css: -------------------------------------------------------------------------------- 1 | .foo { 2 | width: 20px; 3 | bar: val; 4 | } 5 | .bar { 6 | width: test; 7 | } 8 | .example { 9 | value: lookup; 10 | } 11 | -------------------------------------------------------------------------------- /test/css/namespacing/namespacing-media.css: -------------------------------------------------------------------------------- 1 | @media not all and (min-width: 480px) { 2 | .selector { 3 | prop: val; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/css/namespacing/namespacing-operations.css: -------------------------------------------------------------------------------- 1 | .foo { 2 | val: 35px; 3 | } 4 | -------------------------------------------------------------------------------- /test/css/no-output.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdalbertoLacruz/less_dart/9dd9fdd70d987ac4fdac6d788833e411da2cdeba/test/css/no-output.css -------------------------------------------------------------------------------- /test/css/no-strict-math/mixins-guards.css: -------------------------------------------------------------------------------- 1 | .test-2798 { 2 | regression: fixed; 3 | } 4 | .conditions-parser-1 { 5 | only-atomic: ok; 6 | } 7 | .conditions-parser-2 { 8 | only-atomic-with-nested-parenthesis: ok; 9 | } 10 | .conditions-parser-3 { 11 | only-atomic-nested-parenthesis-on-right: ok; 12 | } 13 | -------------------------------------------------------------------------------- /test/css/no-strict-math/no-sm-operations.css: -------------------------------------------------------------------------------- 1 | .named-colors-in-expressions { 2 | color-0: 0 -red; 3 | color-1: #000101; 4 | color-2: #ff0000; 5 | color-3: #ff0000; 6 | background-color: blue-2; 7 | color: green-black; 8 | animation: blue-change 5s infinite; 9 | } 10 | .named-colors-in-expressions-bar-red { 11 | x: y; 12 | } 13 | .named-colors-in-expressions-barred { 14 | a: a; 15 | } 16 | .division { 17 | value: 2px; 18 | } 19 | -------------------------------------------------------------------------------- /test/css/operations.css: -------------------------------------------------------------------------------- 1 | #operations { 2 | color: #111111; 3 | color-2: #f8f800; 4 | height: 9px; 5 | width: 3em; 6 | subtraction: 0; 7 | division: 1; 8 | } 9 | #operations .spacing { 10 | height: 9px; 11 | width: 3em; 12 | } 13 | .with-variables { 14 | height: 16em; 15 | width: 24em; 16 | size: 1cm; 17 | } 18 | .with-functions { 19 | color: #646464; 20 | color: #ff8080; 21 | color: #c94a4a; 22 | } 23 | .negative { 24 | height: 0px; 25 | width: 4px; 26 | } 27 | .shorthands { 28 | padding: -1px 2px 0 -4px; 29 | } 30 | .rem-dimensions { 31 | font-size: 5.5rem; 32 | } 33 | .colors { 34 | color: #123; 35 | border-color: #334455; 36 | background-color: #000000; 37 | } 38 | .colors .other { 39 | color: #222222; 40 | border-color: #222222; 41 | } 42 | .negations { 43 | variable: -4px; 44 | variable1: 0px; 45 | variable2: 0px; 46 | variable3: 8px; 47 | variable4: 0px; 48 | paren: -4px; 49 | paren2: 16px; 50 | } 51 | -------------------------------------------------------------------------------- /test/css/parse-interpolation.css: -------------------------------------------------------------------------------- 1 | input[type=text]:focus, 2 | input[type=email]:focus, 3 | input[type=password]:focus, 4 | textarea:focus { 5 | foo: bar; 6 | } 7 | .a + .z, 8 | .b + .z, 9 | .c + .z { 10 | color: blue; 11 | } 12 | .bar .d.a, 13 | .bar .b, 14 | .c.bar:hover, 15 | .bar baz { 16 | color: blue; 17 | } 18 | .a + .e, 19 | .b.c + .e, 20 | .d + .e { 21 | foo: bar; 22 | } 23 | input[class="text"], 24 | input.text { 25 | background: red; 26 | } 27 | .master-page-1 .selector-1, 28 | .master-page-1 .selector-2 { 29 | background-color: red; 30 | } 31 | .fruit-apple, 32 | .fruit-satsuma, 33 | .fruit-banana, 34 | .fruit-pear { 35 | content: "Just a test."; 36 | } 37 | -------------------------------------------------------------------------------- /test/css/permissive-parse.css: -------------------------------------------------------------------------------- 1 | @-moz-document regexp("(\d{0,15})") { 2 | a { 3 | color: red; 4 | } 5 | } 6 | .custom-property { 7 | --this: () => { 8 | basically anything until final semi-colon; 9 | even other stuff; // i\'m serious; 10 | }; 11 | --that: () => { 12 | basically anything until final semi-colon; 13 | even other stuff; // i\'m serious; 14 | }; 15 | --custom-color: #ff3333 #ff3333; 16 | custom-color: #ff3333 #ff3333; 17 | } 18 | .var { 19 | --fortran: read (*, *, iostat=1) radius, height; 20 | } 21 | @-moz-whatever (foo: "(" bam ")") { 22 | bar: foo; 23 | } 24 | #selector, 25 | .bar, 26 | foo[attr="blah"] { 27 | bar: value; 28 | } 29 | @media (min-width: 640px) { 30 | .holy-crap { 31 | this: works; 32 | } 33 | } 34 | .test-comment { 35 | --value: a /* { ; } */; 36 | --comment-within: ( /* okay?; comment; */ ); 37 | } 38 | -------------------------------------------------------------------------------- /test/css/plugin-preeval.css: -------------------------------------------------------------------------------- 1 | :root.two .one { 2 | --foo: bar !important; 3 | } 4 | -------------------------------------------------------------------------------- /test/css/postProcessorPlugin/postProcessor.css: -------------------------------------------------------------------------------- 1 | hr {height:50px;} 2 | .test { 3 | color: white; 4 | } 5 | -------------------------------------------------------------------------------- /test/css/preProcessorPlugin/preProcessor.css: -------------------------------------------------------------------------------- 1 | .test { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /test/css/property-accessors.css: -------------------------------------------------------------------------------- 1 | .block_1 { 2 | color: red; 3 | background-color: red; 4 | width: 50px; 5 | height: 25px; 6 | border: 1px solid #ff3333; 7 | content: "red"; 8 | prop: red; 9 | } 10 | .block_1:hover { 11 | background-color: green; 12 | color: green; 13 | } 14 | .block_1 .one { 15 | background: red; 16 | } 17 | .block_2 { 18 | color: red; 19 | color: blue; 20 | } 21 | .block_2 .two { 22 | background-color: blue; 23 | } 24 | .block_3 { 25 | color: red; 26 | color: yellow; 27 | color: blue; 28 | } 29 | .block_3 .three { 30 | background-color: blue; 31 | } 32 | .block_4 { 33 | color: red; 34 | color: blue; 35 | color: yellow; 36 | } 37 | .block_4 .four { 38 | background-color: yellow; 39 | } 40 | a { 41 | background-color: red, foo; 42 | } 43 | ab { 44 | background: red, foo; 45 | } 46 | .value_as_property { 47 | prop1: color; 48 | color: #FF0000; 49 | } 50 | -------------------------------------------------------------------------------- /test/css/property-name-interp.css: -------------------------------------------------------------------------------- 1 | pi-test { 2 | border: 0; 3 | @not-variable: @not-variable; 4 | ufo-width: 50%; 5 | *-z-border: 1px dashed blue; 6 | -www-border-top: 2px; 7 | radius-is-not-a-border: true; 8 | border-top-left-radius: 2em; 9 | border-top-red-radius-: 3pt; 10 | global-local-mixer-property: strong; 11 | } 12 | pi-test-merge { 13 | pre-property-ish: high, middle, low, base; 14 | pre-property-ish+: nice try dude; 15 | } 16 | pi-indirect-vars { 17 | auto: auto; 18 | } 19 | pi-complex-values { 20 | 3px rgba(255, 255, 0, 0.5), 3.14159265 /* foo */3px rgba(255, 255, 0, 0.5), 3.14159265 /* foo */: none; 21 | } 22 | -------------------------------------------------------------------------------- /test/css/rewrite-urls-all/rewrite-urls-all.css: -------------------------------------------------------------------------------- 1 | #imported-file { 2 | background-image: url("./folder/relative/path"); 3 | background-image: url("./relative/path"); 4 | background-image: url("../relative/path"); 5 | background-image: url("folder/module"); 6 | background-image: url("folder/module/path"); 7 | background-image: url("folder/module/relative/path"); 8 | } 9 | #rewrite-urls-all { 10 | background-image: url("./relative/path"); 11 | background-image: url("../relative/path"); 12 | background-image: url("./path"); 13 | background-image: url("./"); 14 | background-image: url("module"); 15 | background-image: url("module/path"); 16 | background-image: url("module/relative/path"); 17 | } 18 | -------------------------------------------------------------------------------- /test/css/rewrite-urls-local/rewrite-urls-local.css: -------------------------------------------------------------------------------- 1 | #imported-file { 2 | background-image: url("./folder/relative/path"); 3 | background-image: url("./relative/path"); 4 | background-image: url("../relative/path"); 5 | background-image: url("module"); 6 | background-image: url("module/path"); 7 | background-image: url("module/relative/path"); 8 | } 9 | #rewrite-urls-local { 10 | background-image: url("./relative/path"); 11 | background-image: url("../relative/path"); 12 | background-image: url("./path"); 13 | background-image: url("./"); 14 | background-image: url("module"); 15 | background-image: url("module/path"); 16 | background-image: url("module/relative/path"); 17 | } 18 | -------------------------------------------------------------------------------- /test/css/rootpath-rewrite-urls-all/rootpath-rewrite-urls-all.css: -------------------------------------------------------------------------------- 1 | #imported-file { 2 | background-image: url("http://example.com/assets/css/folder/relative/path"); 3 | background-image: url("http://example.com/assets/css/relative/path"); 4 | background-image: url("http://example.com/assets/relative/path"); 5 | background-image: url("http://example.com/assets/css/folder/module"); 6 | background-image: url("http://example.com/assets/css/folder/module/path"); 7 | background-image: url("http://example.com/assets/css/folder/module/relative/path"); 8 | } 9 | #rootpath-rewrite-urls-all { 10 | background-image: url("http://example.com/assets/css/relative/path"); 11 | background-image: url("http://example.com/assets/relative/path"); 12 | background-image: url("http://example.com/assets/css/path"); 13 | background-image: url("http://example.com/assets/css"); 14 | background-image: url("http://example.com/assets/css/module"); 15 | background-image: url("http://example.com/assets/css/module/path"); 16 | background-image: url("http://example.com/assets/css/module/relative/path"); 17 | } 18 | -------------------------------------------------------------------------------- /test/css/rootpath-rewrite-urls-local/rootpath-rewrite-urls-local.css: -------------------------------------------------------------------------------- 1 | #imported-file { 2 | background-image: url("http://example.com/assets/css/folder/relative/path"); 3 | background-image: url("http://example.com/assets/css/relative/path"); 4 | background-image: url("http://example.com/assets/relative/path"); 5 | background-image: url("module"); 6 | background-image: url("module/path"); 7 | background-image: url("module/relative/path"); 8 | } 9 | #rootpath-rewrite-urls-local { 10 | background-image: url("http://example.com/assets/css/relative/path"); 11 | background-image: url("http://example.com/assets/relative/path"); 12 | background-image: url("http://example.com/assets/css/path"); 13 | background-image: url("http://example.com/assets/css"); 14 | background-image: url("module"); 15 | background-image: url("module/path"); 16 | background-image: url("module/relative/path"); 17 | } 18 | -------------------------------------------------------------------------------- /test/css/rulesets.css: -------------------------------------------------------------------------------- 1 | #first > .one { 2 | font-size: 2em; 3 | } 4 | #first > .one > #second .two > #deux { 5 | width: 50%; 6 | } 7 | #first > .one > #second .two > #deux #third { 8 | height: 100%; 9 | } 10 | #first > .one > #second .two > #deux #third:focus { 11 | color: black; 12 | } 13 | #first > .one > #second .two > #deux #third:focus #fifth > #sixth .seventh #eighth + #ninth { 14 | color: purple; 15 | } 16 | #first > .one > #second .two > #deux #fourth, 17 | #first > .one > #second .two > #deux #five, 18 | #first > .one > #second .two > #deux #six { 19 | color: #110000; 20 | } 21 | #first > .one > #second .two > #deux #fourth .seven, 22 | #first > .one > #second .two > #deux #five .seven, 23 | #first > .one > #second .two > #deux #six .seven, 24 | #first > .one > #second .two > #deux #fourth .eight > #nine, 25 | #first > .one > #second .two > #deux #five .eight > #nine, 26 | #first > .one > #second .two > #deux #six .eight > #nine { 27 | border: 1px solid black; 28 | } 29 | #first > .one > #second .two > #deux #fourth #ten, 30 | #first > .one > #second .two > #deux #five #ten, 31 | #first > .one > #second .two > #deux #six #ten { 32 | color: red; 33 | } 34 | -------------------------------------------------------------------------------- /test/css/scope.css: -------------------------------------------------------------------------------- 1 | .tiny-scope { 2 | color: #989; 3 | } 4 | .scope1 { 5 | color: blue; 6 | border-color: black; 7 | } 8 | .scope1 .scope2 { 9 | color: blue; 10 | } 11 | .scope1 .scope2 .scope3 { 12 | color: red; 13 | border-color: black; 14 | background-color: white; 15 | } 16 | .scope { 17 | scoped-val: green; 18 | } 19 | .heightIsSet { 20 | height: 1024px; 21 | } 22 | .useHeightInMixinCall { 23 | mixin-height: 1024px; 24 | } 25 | .imported { 26 | exists: true; 27 | } 28 | .testImported { 29 | exists: true; 30 | } 31 | #allAreUsedHere { 32 | default: 'top level'; 33 | scope: 'top level'; 34 | sub-scope-only: 'inside'; 35 | } 36 | #parentSelectorScope { 37 | prop: white; 38 | } 39 | -------------------------------------------------------------------------------- /test/css/sourcemaps-empty/empty.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdalbertoLacruz/less_dart/9dd9fdd70d987ac4fdac6d788833e411da2cdeba/test/css/sourcemaps-empty/empty.css -------------------------------------------------------------------------------- /test/css/strict-units/strict-units.css: -------------------------------------------------------------------------------- 1 | .units { 2 | cancels-to-nothing: 1; 3 | cancels: 6px; 4 | } 5 | -------------------------------------------------------------------------------- /test/css/variables-in-at-rules.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @namespace less "http://lesscss.org"; 3 | @keyframes enlarger { 4 | from { 5 | font-size: 12px; 6 | } 7 | to { 8 | font-size: 15px; 9 | } 10 | } 11 | @-webkit-keyframes reducer { 12 | from { 13 | font-size: 13px; 14 | } 15 | to { 16 | font-size: 10px; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/css/visitorPlugin/visitor.css: -------------------------------------------------------------------------------- 1 | .test { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /test/css/whitespace.css: -------------------------------------------------------------------------------- 1 | .whitespace { 2 | color: white; 3 | } 4 | .whitespace { 5 | color: white; 6 | } 7 | .whitespace { 8 | color: white; 9 | } 10 | .whitespace { 11 | color: white; 12 | } 13 | .whitespace { 14 | color: white ; 15 | } 16 | .white, 17 | .space, 18 | .mania { 19 | color: white; 20 | } 21 | .no-semi-column { 22 | color: white; 23 | } 24 | .no-semi-column { 25 | color: white; 26 | white-space: pre; 27 | } 28 | .no-semi-column { 29 | border: 2px solid white; 30 | } 31 | .newlines { 32 | background: the, 33 | great, 34 | wall; 35 | border: 2px 36 | solid 37 | black; 38 | } 39 | .sel .newline_ws .tab_ws { 40 | color: white; 41 | background-position: 45 -23; 42 | } 43 | -------------------------------------------------------------------------------- /test/data/data-uri-fail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdalbertoLacruz/less_dart/9dd9fdd70d987ac4fdac6d788833e411da2cdeba/test/data/data-uri-fail.png -------------------------------------------------------------------------------- /test/data/image-size-lossless.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdalbertoLacruz/less_dart/9dd9fdd70d987ac4fdac6d788833e411da2cdeba/test/data/image-size-lossless.webp -------------------------------------------------------------------------------- /test/data/image-size-lossy.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdalbertoLacruz/less_dart/9dd9fdd70d987ac4fdac6d788833e411da2cdeba/test/data/image-size-lossy.webp -------------------------------------------------------------------------------- /test/data/image-size.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdalbertoLacruz/less_dart/9dd9fdd70d987ac4fdac6d788833e411da2cdeba/test/data/image-size.bmp -------------------------------------------------------------------------------- /test/data/image-size.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdalbertoLacruz/less_dart/9dd9fdd70d987ac4fdac6d788833e411da2cdeba/test/data/image-size.gif -------------------------------------------------------------------------------- /test/data/image-size.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdalbertoLacruz/less_dart/9dd9fdd70d987ac4fdac6d788833e411da2cdeba/test/data/image-size.jpg -------------------------------------------------------------------------------- /test/data/image-size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdalbertoLacruz/less_dart/9dd9fdd70d987ac4fdac6d788833e411da2cdeba/test/data/image-size.png -------------------------------------------------------------------------------- /test/data/image-size.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdalbertoLacruz/less_dart/9dd9fdd70d987ac4fdac6d788833e411da2cdeba/test/data/image-size.psd -------------------------------------------------------------------------------- /test/data/image-size.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /test/data/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdalbertoLacruz/less_dart/9dd9fdd70d987ac4fdac6d788833e411da2cdeba/test/data/image.jpg -------------------------------------------------------------------------------- /test/data/image.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /test/data/page.html: -------------------------------------------------------------------------------- 1 |

This page is 100% Awesome.

2 | -------------------------------------------------------------------------------- /test/less/3rd-party/bootstrap.less: -------------------------------------------------------------------------------- 1 | @import (less) 'https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.css'; 2 | -------------------------------------------------------------------------------- /test/less/calc.less: -------------------------------------------------------------------------------- 1 | @val: 10px; 2 | .no-math { 3 | @c: 10px + 20px; 4 | @calc: (@val + 30px); 5 | root: calc(100% - @c); 6 | root2: calc(100% - @calc); 7 | @var: 50vh/2; 8 | width: calc(50% + (@var - 20px)); 9 | height: calc(50% + ((@var - 20px))); 10 | min-height: calc(((10vh)) + calc((5vh))); 11 | foo: 1 + 2 calc(3 + 4) 5 + 6; 12 | @floor: floor(1 + .1); 13 | bar: calc(@floor + 20%); 14 | } 15 | 16 | .b { 17 | @a: 10px; 18 | @b: 10px; 19 | one: calc(100% - ((min(@a + @b)))); 20 | two: calc(100% - (((@a + @b)))); 21 | three: calc(e('100%') - (3 * 1)); 22 | four: calc(~'100%' - (3 * 1)); 23 | nested: calc(calc(2.25rem + 2px) - 1px * 2); 24 | } 25 | 26 | .c { 27 | @v: 10px; 28 | height: calc(100% - ((@v * 3) + (@v * 2))); 29 | } 30 | -------------------------------------------------------------------------------- /test/less/charsets.less: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | @import "import/import-charset-test"; -------------------------------------------------------------------------------- /test/less/cleancss/colors-no.less: -------------------------------------------------------------------------------- 1 | #color { 2 | color: yellow; 3 | transparent: rgba(0, 0, 0, 0); 4 | alpha: rgba(20, 20, 20, 0.56); 5 | hex6: #456789; 6 | hex3: #445566; 7 | coral: #ff7f50; 8 | } -------------------------------------------------------------------------------- /test/less/cleancss/main-ie7.less: -------------------------------------------------------------------------------- 1 | @import "main"; 2 | -------------------------------------------------------------------------------- /test/less/cleancss/main-ie8.less: -------------------------------------------------------------------------------- 1 | @import "main"; 2 | -------------------------------------------------------------------------------- /test/less/cleancss/main-skip-advanced.less: -------------------------------------------------------------------------------- 1 | @import "main"; 2 | -------------------------------------------------------------------------------- /test/less/compression/compression.less: -------------------------------------------------------------------------------- 1 | #colours { 2 | color1: #fea; 3 | color2: #ffeeaa; 4 | color3: rgba(255, 238, 170, 0.1); 5 | @color1: #fea; 6 | string: "@{color1}"; 7 | /* comments are stripped */ 8 | // both types! 9 | /*! but not this type 10 | Note preserved whitespace 11 | */ 12 | } 13 | dimensions { 14 | val: 0.1px; 15 | val: 0em; 16 | val: 4cm; 17 | val: 0.2; 18 | val: 5; 19 | angles-must-have-unit: 0deg; 20 | durations-must-have-unit: 0s; 21 | length-doesnt-have-unit: 0px; 22 | width: auto\9; 23 | } 24 | @page { 25 | marks: none; 26 | @top-left-corner { 27 | vertical-align: top; 28 | } 29 | @top-left { 30 | vertical-align: top; 31 | } 32 | } 33 | .shadow ^ .dom, 34 | body ^^ .shadow { 35 | display: done; 36 | } 37 | -------------------------------------------------------------------------------- /test/less/css-escapes.less: -------------------------------------------------------------------------------- 1 | @ugly: fuchsia; 2 | 3 | .escape\|random\|char { 4 | color: red; 5 | } 6 | 7 | .mixin\!tUp { 8 | font-weight: bold; 9 | } 10 | 11 | // class="404" 12 | .\34 04 { 13 | background: red; 14 | 15 | strong { 16 | color: @ugly; 17 | .mixin\!tUp; 18 | } 19 | } 20 | 21 | .trailingTest\+ { 22 | color: red; 23 | } 24 | 25 | /* This hideous test of hideousness checks for the selector "blockquote" with various permutations of hex escapes */ 26 | \62\6c\6f \63 \6B \0071 \000075o\74 e { 27 | color: silver; 28 | } 29 | 30 | [ng\:cloak], 31 | ng\:form { 32 | display: none; 33 | } 34 | 35 | // In Bootstrap v3 36 | .bootstrap { 37 | background-color: #000 \9; 38 | } 39 | 40 | textarea { 41 | font-family: 'helvetica neue','wenquanyi micro hei',\5FAE\8F6F\96C5\9ED1, \5B8B\4F53, sans-serif; 42 | } 43 | 44 | e('anything to unquote'); 45 | -------------------------------------------------------------------------------- /test/less/debug/import/test.less: -------------------------------------------------------------------------------- 1 | @charset "ISO-8859-1"; 2 | 3 | .mixin_import1() { 4 | @media all { 5 | .tst { 6 | color: black; 7 | @media screen { 8 | color: red; 9 | .tst3 { 10 | color: white; 11 | } 12 | } 13 | } 14 | } 15 | } 16 | 17 | .mixin_import2() { 18 | .tst2 { 19 | color: white; 20 | } 21 | } 22 | 23 | .tst3 { 24 | color: grey; 25 | } -------------------------------------------------------------------------------- /test/less/debug/linenumbers.less: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | @import "import/test.less"; 4 | 5 | .start() { 6 | .test2 { 7 | color: red; 8 | } 9 | } 10 | 11 | .mix() { 12 | color: black; 13 | } 14 | 15 | .test1 { 16 | .mix(); 17 | } 18 | 19 | .start(); 20 | 21 | .mixin_import1(); 22 | 23 | .mixin_import2(); 24 | 25 | @debug: 1; 26 | & when (@debug = 1) { 27 | .test { 28 | color: red; 29 | & when (@debug = 1) { 30 | width: 2; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /test/less/empty.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdalbertoLacruz/less_dart/9dd9fdd70d987ac4fdac6d788833e411da2cdeba/test/less/empty.less -------------------------------------------------------------------------------- /test/less/errors/add-mixed-units.less: -------------------------------------------------------------------------------- 1 | .a { 2 | error: (1px + 3em); 3 | } -------------------------------------------------------------------------------- /test/less/errors/add-mixed-units.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Incompatible units. Change the units or use the unit function. Bad units: 'px' and 'em'. in {path}add-mixed-units.less on line 2, column 3: 2 | 1 .a { 3 | 2 error: (1px + 3em); 4 | ....^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/add-mixed-units2.less: -------------------------------------------------------------------------------- 1 | .a { 2 | error: ((1px * 2px) + (3em * 3px)); 3 | } -------------------------------------------------------------------------------- /test/less/errors/add-mixed-units2.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Incompatible units. Change the units or use the unit function. Bad units: 'px*px' and 'em*px'. in {path}add-mixed-units2.less on line 2, column 3: 2 | 1 .a { 3 | 2 error: ((1px * 2px) + (3em * 3px)); 4 | ....^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/at-rules-undefined-var.less: -------------------------------------------------------------------------------- 1 | 2 | @keyframes @name { 3 | 50% {width: 20px;} 4 | } 5 | -------------------------------------------------------------------------------- /test/less/errors/at-rules-undefined-var.txt: -------------------------------------------------------------------------------- 1 | NameError: variable @name is undefined in {path}at-rules-undefined-var.less on line 2, column 12: 2 | 1 3 | 2 @keyframes @name { 4 | .............^ 5 | 3 50% {width: 20px;} 6 | -------------------------------------------------------------------------------- /test/less/errors/at-rules-unmatching-block.less: -------------------------------------------------------------------------------- 1 | 2 | @unknown url( { 3 | 50% {width: 20px;} 4 | } 5 | -------------------------------------------------------------------------------- /test/less/errors/at-rules-unmatching-block.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: expected ')' got '' in {path}at-rules-unmatching-block.less on line 5, column 1: 2 | 4 } 3 | 5 4 | ..^ 5 | -------------------------------------------------------------------------------- /test/less/errors/bad-variable-declaration1.less: -------------------------------------------------------------------------------- 1 | @@demo: "hi"; -------------------------------------------------------------------------------- /test/less/errors/bad-variable-declaration1.txt: -------------------------------------------------------------------------------- 1 | ParseError: Unrecognised input in {path}bad-variable-declaration1.less on line 1, column 1: 2 | 1 @@demo: "hi"; 3 | ..^ 4 | -------------------------------------------------------------------------------- /test/less/errors/color-func-invalid-color-2.less: -------------------------------------------------------------------------------- 1 | // https://github.com/less/less.js/issues/3338 2 | @base-color: darken(var(--baseColor, red), 50%); -------------------------------------------------------------------------------- /test/less/errors/color-func-invalid-color-2.txt: -------------------------------------------------------------------------------- 1 | RuntimeError: error evaluating function `darken`: Argument cannot be evaluated to a color in {path}color-func-invalid-color-2.less on line 2, column 14: 2 | 1 // https://github.com/less/less.js/issues/3338 3 | 2 @base-color: darken(var(--baseColor, red), 50%); 4 | ...............^ 5 | -------------------------------------------------------------------------------- /test/less/errors/color-func-invalid-color.less: -------------------------------------------------------------------------------- 1 | .test { 2 | color: color("NOT A COLOR"); 3 | } -------------------------------------------------------------------------------- /test/less/errors/color-func-invalid-color.txt: -------------------------------------------------------------------------------- 1 | ArgumentError: error evaluating function `color`: argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF in {path}color-func-invalid-color.less on line 2, column 10: 2 | 1 .test { 3 | 2 color: color("NOT A COLOR"); 4 | ...........^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/comment-in-selector.less: -------------------------------------------------------------------------------- 1 | #gaga /* Comment */ span { color: red } -------------------------------------------------------------------------------- /test/less/errors/comment-in-selector.txt: -------------------------------------------------------------------------------- 1 | ParseError: Unrecognised input in {path}comment-in-selector.less on line 1, column 21: 2 | 1 #gaga /* Comment */ span { color: red } 3 | ......................^ 4 | -------------------------------------------------------------------------------- /test/less/errors/css-guard-default-func.less: -------------------------------------------------------------------------------- 1 | 2 | selector when (default()) { 3 | color: red; 4 | } 5 | -------------------------------------------------------------------------------- /test/less/errors/css-guard-default-func.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: error evaluating function `default`: it is currently only allowed in parametric mixin guards, in {path}css-guard-default-func.less on line 2, column 16: 2 | 1 3 | 2 selector when (default()) { 4 | .................^ 5 | 3 color: red; 6 | -------------------------------------------------------------------------------- /test/less/errors/custom-property-unmatched-block-1.less: -------------------------------------------------------------------------------- 1 | .custom { 2 | --custom: ({ 3 | this; 4 | is-unmatched: [ 5 | }) 6 | } -------------------------------------------------------------------------------- /test/less/errors/custom-property-unmatched-block-1.txt: -------------------------------------------------------------------------------- 1 | ParseError: Expected ']' in {path}custom-property-unmatched-block-1.less on line 5, column 3: 2 | 4 is-unmatched: [ 3 | 5 }) 4 | ....^ 5 | 6 } 6 | -------------------------------------------------------------------------------- /test/less/errors/custom-property-unmatched-block-2.less: -------------------------------------------------------------------------------- 1 | .custom { 2 | --custom: {{ 3 | this; 4 | is-unmatched: [ 5 | }} 6 | } -------------------------------------------------------------------------------- /test/less/errors/custom-property-unmatched-block-2.txt: -------------------------------------------------------------------------------- 1 | ParseError: Expected ']' in {path}custom-property-unmatched-block-2.less on line 5, column 3: 2 | 4 is-unmatched: [ 3 | 5 }} 4 | ....^ 5 | 6 } 6 | -------------------------------------------------------------------------------- /test/less/errors/custom-property-unmatched-block-3.less: -------------------------------------------------------------------------------- 1 | .custom { 2 | --custom: {{ 3 | this; 4 | is-unmatched: " 5 | }} 6 | } -------------------------------------------------------------------------------- /test/less/errors/custom-property-unmatched-block-3.txt: -------------------------------------------------------------------------------- 1 | ParseError: Expected '"' in {path}custom-property-unmatched-block-3.less on line 4, column 19: 2 | 3 this; 3 | 4 is-unmatched: " 4 | ....................^ 5 | 5 }} 6 | -------------------------------------------------------------------------------- /test/less/errors/detached-ruleset-1.less: -------------------------------------------------------------------------------- 1 | @a: { 2 | b: 1; 3 | }; 4 | .a { 5 | a: @a; 6 | } -------------------------------------------------------------------------------- /test/less/errors/detached-ruleset-1.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Rulesets cannot be evaluated on a property. in {path}detached-ruleset-1.less on line 5, column 3: 2 | 4 .a { 3 | 5 a: @a; 4 | ....^ 5 | 6 } 6 | -------------------------------------------------------------------------------- /test/less/errors/detached-ruleset-2.less: -------------------------------------------------------------------------------- 1 | @a: { 2 | b: 1; 3 | }; 4 | .a { 5 | a: @a(); 6 | } -------------------------------------------------------------------------------- /test/less/errors/detached-ruleset-2.txt: -------------------------------------------------------------------------------- 1 | ParseError: Missing '[...]' lookup in variable call in {path}detached-ruleset-2.less on line 5, column 10: 2 | 4 .a { 3 | 5 a: @a(); 4 | ...........^ 5 | 6 } 6 | -------------------------------------------------------------------------------- /test/less/errors/detached-ruleset-3.less: -------------------------------------------------------------------------------- 1 | @a: { 2 | b: 1; 3 | }; 4 | @a(); -------------------------------------------------------------------------------- /test/less/errors/detached-ruleset-3.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Properties must be inside selector blocks. They cannot be in the root in {path}detached-ruleset-3.less on line 2, column 3: 2 | 1 @a: { 3 | 2 b: 1; 4 | ....^ 5 | 3 }; 6 | -------------------------------------------------------------------------------- /test/less/errors/detached-ruleset-5.less: -------------------------------------------------------------------------------- 1 | .mixin-definition(@b) { 2 | @a(); 3 | } 4 | .mixin-definition({color: red;}); -------------------------------------------------------------------------------- /test/less/errors/detached-ruleset-5.txt: -------------------------------------------------------------------------------- 1 | NameError: variable @a is undefined in {path}detached-ruleset-5.less on line 2, column 3: 2 | 1 .mixin-definition(@b) { 3 | 2 @a(); 4 | ....^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/detached-ruleset-6.less: -------------------------------------------------------------------------------- 1 | .a { 2 | b: { 3 | color: red; 4 | }; 5 | } -------------------------------------------------------------------------------- /test/less/errors/detached-ruleset-6.txt: -------------------------------------------------------------------------------- 1 | ParseError: Unrecognised input in {path}detached-ruleset-6.less on line 2, column 6: 2 | 1 .a { 3 | 2 b: { 4 | .......^ 5 | 3 color: red; 6 | -------------------------------------------------------------------------------- /test/less/errors/divide-mixed-units.less: -------------------------------------------------------------------------------- 1 | .a { 2 | error: (1px / 3em); 3 | } -------------------------------------------------------------------------------- /test/less/errors/divide-mixed-units.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Multiple units in dimension. Correct the units or use the unit function. Bad unit: px/em in {path}divide-mixed-units.less on line 2, column 3: 2 | 1 .a { 3 | 2 error: (1px / 3em); 4 | ....^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/extend-no-selector.less: -------------------------------------------------------------------------------- 1 | :extend(.a all) { 2 | property: red; 3 | } -------------------------------------------------------------------------------- /test/less/errors/extend-no-selector.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Extend must be used to extend a selector, it cannot be used on its own in {path}extend-no-selector.less on line 1, column 17: 2 | 1 :extend(.a all) { 3 | ..................^ 4 | 2 property: red; 5 | -------------------------------------------------------------------------------- /test/less/errors/extend-not-at-end.less: -------------------------------------------------------------------------------- 1 | .a:extend(.b all).c { 2 | property: red; 3 | } -------------------------------------------------------------------------------- /test/less/errors/extend-not-at-end.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Extend can only be used at the end of selector in {path}extend-not-at-end.less on line 1, column 21: 2 | 1 .a:extend(.b all).c { 3 | ......................^ 4 | 2 property: red; 5 | -------------------------------------------------------------------------------- /test/less/errors/functions-1.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-undefined(); 3 | -------------------------------------------------------------------------------- /test/less/errors/functions-1.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Function 'test-undefined' is undefined in {path}functions-1.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-undefined(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/functions-10-keyword.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-keyword(); 3 | -------------------------------------------------------------------------------- /test/less/errors/functions-10-keyword.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Keyword node returned by a function is not valid here in {path}functions-10-keyword.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-keyword(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/functions-11-operation.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-operation(); 3 | -------------------------------------------------------------------------------- /test/less/errors/functions-11-operation.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Operation node returned by a function is not valid here in {path}functions-11-operation.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-operation(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/functions-12-quoted.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-quoted(); 3 | -------------------------------------------------------------------------------- /test/less/errors/functions-12-quoted.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Quoted node returned by a function is not valid here in {path}functions-12-quoted.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-quoted(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/functions-13-selector.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-selector(); 3 | -------------------------------------------------------------------------------- /test/less/errors/functions-13-selector.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Selector node returned by a function is not valid here in {path}functions-13-selector.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-selector(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/functions-14-url.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-url(); 3 | -------------------------------------------------------------------------------- /test/less/errors/functions-14-url.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Url node returned by a function is not valid here in {path}functions-14-url.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-url(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/functions-15-value.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-value(); 3 | -------------------------------------------------------------------------------- /test/less/errors/functions-15-value.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Value node returned by a function is not valid here in {path}functions-15-value.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-value(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/functions-3-assignment.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-assignment(); 3 | -------------------------------------------------------------------------------- /test/less/errors/functions-3-assignment.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Assignment node returned by a function is not valid here in {path}functions-3-assignment.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-assignment(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/functions-4-call.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-call(); 3 | -------------------------------------------------------------------------------- /test/less/errors/functions-4-call.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Function 'foo' is undefined in {path}functions-4-call.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-call(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/functions-5-color-2.less: -------------------------------------------------------------------------------- 1 | rgba(0,0,0,0); -------------------------------------------------------------------------------- /test/less/errors/functions-5-color-2.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Color node returned by a function is not valid here in {path}functions-5-color-2.less on line 1, column 1: 2 | 1 rgba(0,0,0,0); 3 | ..^ 4 | -------------------------------------------------------------------------------- /test/less/errors/functions-5-color.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-color(); 3 | -------------------------------------------------------------------------------- /test/less/errors/functions-5-color.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Color node returned by a function is not valid here in {path}functions-5-color.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-color(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/functions-6-condition.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-condition(); 3 | -------------------------------------------------------------------------------- /test/less/errors/functions-6-condition.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Condition node returned by a function is not valid here in {path}functions-6-condition.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-condition(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/functions-7-dimension.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-dimension(); 3 | -------------------------------------------------------------------------------- /test/less/errors/functions-7-dimension.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Dimension node returned by a function is not valid here in {path}functions-7-dimension.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-dimension(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/functions-8-element.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-element(); 3 | -------------------------------------------------------------------------------- /test/less/errors/functions-8-element.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Element node returned by a function is not valid here in {path}functions-8-element.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-element(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/functions-9-expression.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-expression(); 3 | -------------------------------------------------------------------------------- /test/less/errors/functions-9-expression.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Expression node returned by a function is not valid here in {path}functions-9-expression.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-expression(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/import-malformed.less: -------------------------------------------------------------------------------- 1 | @import malformed "this-statement-is-invalid.less"; 2 | -------------------------------------------------------------------------------- /test/less/errors/import-malformed.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: malformed import statement in {path}import-malformed.less on line 1, column 1: 2 | 1 @import malformed "this-statement-is-invalid.less"; 3 | ..^ 4 | 2 5 | -------------------------------------------------------------------------------- /test/less/errors/import-missing.less: -------------------------------------------------------------------------------- 1 | .a { 2 | color: green; 3 | // tests line number for import reference is correct 4 | } 5 | 6 | @import "file-does-not-exist.less"; -------------------------------------------------------------------------------- /test/less/errors/import-missing.txt: -------------------------------------------------------------------------------- 1 | FileError: '{pathhref}file-does-not-exist.less' wasn't found{404status}. Tried - {path}file-does-not-exist.less, file-does-not-exist.less in {path}import-missing.less on line 6, column 1: 2 | 5 3 | 6 @import "file-does-not-exist.less"; 4 | ..^ 5 | -------------------------------------------------------------------------------- /test/less/errors/import-no-semi.less: -------------------------------------------------------------------------------- 1 | @import "this-statement-is-invalid.less" -------------------------------------------------------------------------------- /test/less/errors/import-no-semi.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: missing semi-colon or unrecognised media features on import in {path}import-no-semi.less on line 1, column 1: 2 | 1 @import "this-statement-is-invalid.less" 3 | ..^ 4 | -------------------------------------------------------------------------------- /test/less/errors/import-subfolder1.less: -------------------------------------------------------------------------------- 1 | @import "imports/import-subfolder1.less"; -------------------------------------------------------------------------------- /test/less/errors/import-subfolder1.txt: -------------------------------------------------------------------------------- 1 | NameError: .mixin-not-defined is undefined in {path}mixin-not-defined.less on line 11, column 1: 2 | 10 3 | 11 .mixin-not-defined(); 4 | ...^ 5 | -------------------------------------------------------------------------------- /test/less/errors/import-subfolder2-chunker.txt: -------------------------------------------------------------------------------- 1 | ParseError: missing opening `{` in {path}parse-error-curly-bracket.less on line 4, column 1: 2 | 3 } 3 | 4 } 4 | ..^ 5 | 5 6 | -------------------------------------------------------------------------------- /test/less/errors/import-subfolder2.less: -------------------------------------------------------------------------------- 1 | @import "imports/import-subfolder2.less"; -------------------------------------------------------------------------------- /test/less/errors/import-subfolder2.txt: -------------------------------------------------------------------------------- 1 | ParseError: Unrecognised input. Possibly missing opening '{' in {path}parse-error-curly-bracket.less on line 4, column 1: 2 | 3 } 3 | 4 } 4 | ..^ 5 | 5 6 | -------------------------------------------------------------------------------- /test/less/errors/imports/import-subfolder1.less: -------------------------------------------------------------------------------- 1 | @import "subfolder/mixin-not-defined.less"; -------------------------------------------------------------------------------- /test/less/errors/imports/import-subfolder2.less: -------------------------------------------------------------------------------- 1 | @import "subfolder/parse-error-curly-bracket.less"; -------------------------------------------------------------------------------- /test/less/errors/imports/import-test.less: -------------------------------------------------------------------------------- 1 | .someclass 2 | { 3 | font-weight: bold; 4 | } -------------------------------------------------------------------------------- /test/less/errors/imports/subfolder/mixin-not-defined.less: -------------------------------------------------------------------------------- 1 | @import "../../mixin-not-defined.less"; -------------------------------------------------------------------------------- /test/less/errors/imports/subfolder/parse-error-curly-bracket.less: -------------------------------------------------------------------------------- 1 | @import "../../parse-error-curly-bracket.less"; -------------------------------------------------------------------------------- /test/less/errors/javascript-error.less: -------------------------------------------------------------------------------- 1 | .scope { 2 | var: `this.foo.toJS`; 3 | } 4 | -------------------------------------------------------------------------------- /test/less/errors/javascript-error.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: JavaScript evaluation error: 'TypeError: Cannot read property 'toJS' of undefined' in {path}javascript-error.less on line 2, column 10: 2 | 1 .scope { 3 | 2 var: `this.foo.toJS`; 4 | 3 } 5 | -------------------------------------------------------------------------------- /test/less/errors/javascript-undefined-var.less: -------------------------------------------------------------------------------- 1 | .scope { 2 | @a: `@{b}`; 3 | } 4 | -------------------------------------------------------------------------------- /test/less/errors/javascript-undefined-var.txt: -------------------------------------------------------------------------------- 1 | NameError: variable @b is undefined in {path}javascript-undefined-var.less on line 2, column 9: 2 | 1 .scope { 3 | 2 @a: `@{b}`; 4 | 3 } 5 | -------------------------------------------------------------------------------- /test/less/errors/mixed-mixin-definition-args-1.less: -------------------------------------------------------------------------------- 1 | .mixin(@a : 4, @b : 3, @c: 2) { 2 | will: fail; 3 | } 4 | .mixin-test { 5 | .mixin(@a: 5; @b: 6, @c: 7); 6 | } -------------------------------------------------------------------------------- /test/less/errors/mixed-mixin-definition-args-1.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Cannot mix ; and , as delimiter types in {path}mixed-mixin-definition-args-1.less on line 5, column 30: 2 | 4 .mixin-test { 3 | 5 .mixin(@a: 5; @b: 6, @c: 7); 4 | ...............................^ 5 | 6 } 6 | -------------------------------------------------------------------------------- /test/less/errors/mixed-mixin-definition-args-2.less: -------------------------------------------------------------------------------- 1 | .mixin(@a : 4, @b : 3, @c: 2) { 2 | will: fail; 3 | } 4 | .mixin-test { 5 | .mixin(@a: 5, @b: 6; @c: 7); 6 | } 7 | -------------------------------------------------------------------------------- /test/less/errors/mixed-mixin-definition-args-2.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Cannot mix ; and , as delimiter types in {path}mixed-mixin-definition-args-2.less on line 5, column 26: 2 | 4 .mixin-test { 3 | 5 .mixin(@a: 5, @b: 6; @c: 7); 4 | ...........................^ 5 | 6 } 6 | -------------------------------------------------------------------------------- /test/less/errors/mixin-not-defined-2.less: -------------------------------------------------------------------------------- 1 | .non-matching-mixin(@a @b) { 2 | args: @a @b; 3 | } 4 | 5 | x { 6 | .non-matching-mixin(x, y); 7 | } -------------------------------------------------------------------------------- /test/less/errors/mixin-not-defined-2.txt: -------------------------------------------------------------------------------- 1 | RuntimeError: No matching definition was found for `.non-matching-mixin(x, y)` in {path}mixin-not-defined-2.less on line 6, column 3: 2 | 5 x { 3 | 6 .non-matching-mixin(x, y); 4 | ....^ 5 | 7 } 6 | -------------------------------------------------------------------------------- /test/less/errors/mixin-not-defined.less: -------------------------------------------------------------------------------- 1 | 2 | .error-is-further-on() { 3 | } 4 | 5 | .pad-here-to-reproduce-error-in() { 6 | } 7 | 8 | .the-import-subfolder-test() { 9 | } 10 | 11 | .mixin-not-defined(); -------------------------------------------------------------------------------- /test/less/errors/mixin-not-defined.txt: -------------------------------------------------------------------------------- 1 | NameError: .mixin-not-defined is undefined in {path}mixin-not-defined.less on line 11, column 1: 2 | 10 3 | 11 .mixin-not-defined(); 4 | ...^ 5 | -------------------------------------------------------------------------------- /test/less/errors/mixin-not-matched.less: -------------------------------------------------------------------------------- 1 | @saxofon:trumpete; 2 | 3 | .mixin(saxofon) { 4 | } 5 | 6 | .mixin(@saxofon); -------------------------------------------------------------------------------- /test/less/errors/mixin-not-matched.txt: -------------------------------------------------------------------------------- 1 | RuntimeError: No matching definition was found for `.mixin(trumpete)` in {path}mixin-not-matched.less on line 6, column 1: 2 | 5 3 | 6 .mixin(@saxofon); 4 | ..^ 5 | -------------------------------------------------------------------------------- /test/less/errors/mixin-not-matched2.less: -------------------------------------------------------------------------------- 1 | @saxofon:trumpete; 2 | 3 | .mixin(@a, @b) { 4 | } 5 | 6 | .mixin(@a: @saxofon); -------------------------------------------------------------------------------- /test/less/errors/mixin-not-matched2.txt: -------------------------------------------------------------------------------- 1 | RuntimeError: No matching definition was found for `.mixin(@a:trumpete)` in {path}mixin-not-matched2.less on line 6, column 1: 2 | 5 3 | 6 .mixin(@a: @saxofon); 4 | ..^ 5 | -------------------------------------------------------------------------------- /test/less/errors/mixin-not-visible-in-scope-1.less: -------------------------------------------------------------------------------- 1 | .something { 2 | & { 3 | .a {value: a} 4 | } 5 | 6 | & { 7 | .b {.a} // was Err. before 1.6.2 8 | } 9 | } -------------------------------------------------------------------------------- /test/less/errors/mixin-not-visible-in-scope-1.txt: -------------------------------------------------------------------------------- 1 | NameError: .a is undefined in {path}mixin-not-visible-in-scope-1.less on line 7, column 13: 2 | 6 & { 3 | 7 .b {.a} // was Err. before 1.6.2 4 | ..............^ 5 | 8 } 6 | -------------------------------------------------------------------------------- /test/less/errors/mixins-guards-cond-expected.less: -------------------------------------------------------------------------------- 1 | .max (@a, @b) when @a { 2 | width: @b; 3 | } 4 | 5 | .max1 { .max(3, 6) } 6 | -------------------------------------------------------------------------------- /test/less/errors/mixins-guards-cond-expected.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: expected condition in {path}mixins-guards-cond-expected.less on line 1, column 20: 2 | 1 .max (@a, @b) when @a { 3 | .....................^ 4 | 2 width: @b; 5 | -------------------------------------------------------------------------------- /test/less/errors/mixins-guards-default-func-1.less: -------------------------------------------------------------------------------- 1 | 2 | guard-default-func-conflict { 3 | .m(@x, 1) {} 4 | .m(@x, 2) when (default()) {} 5 | .m(@x, 2) when (default()) {} 6 | 7 | .m(1, 1); 8 | .m(1, 2); 9 | } 10 | -------------------------------------------------------------------------------- /test/less/errors/mixins-guards-default-func-1.txt: -------------------------------------------------------------------------------- 1 | RuntimeError: Ambiguous use of `default()` found when matching for `.m(1, 2)` in {path}mixins-guards-default-func-1.less on line 8, column 5: 2 | 7 .m(1, 1); 3 | 8 .m(1, 2); 4 | ......^ 5 | 9 } 6 | -------------------------------------------------------------------------------- /test/less/errors/mixins-guards-default-func-2.less: -------------------------------------------------------------------------------- 1 | 2 | guard-default-func-conflict { 3 | .m(1) {} 4 | .m(@x) when not(default()) {} 5 | .m(@x) when (@x = 3) and (default()) {} 6 | 7 | .m(2); 8 | .m(3); 9 | } 10 | -------------------------------------------------------------------------------- /test/less/errors/mixins-guards-default-func-2.txt: -------------------------------------------------------------------------------- 1 | RuntimeError: Ambiguous use of `default()` found when matching for `.m(3)` in {path}mixins-guards-default-func-2.less on line 8, column 5: 2 | 7 .m(2); 3 | 8 .m(3); 4 | ......^ 5 | 9 } 6 | -------------------------------------------------------------------------------- /test/less/errors/mixins-guards-default-func-3.less: -------------------------------------------------------------------------------- 1 | 2 | guard-default-func-conflict { 3 | .m(1) {} 4 | .m(@x) when not(default()) {} 5 | .m(@x) when not(default()) {} 6 | 7 | .m(1); 8 | .m(2); 9 | } 10 | -------------------------------------------------------------------------------- /test/less/errors/mixins-guards-default-func-3.txt: -------------------------------------------------------------------------------- 1 | RuntimeError: Ambiguous use of `default()` found when matching for `.m(2)` in {path}mixins-guards-default-func-3.less on line 8, column 5: 2 | 7 .m(1); 3 | 8 .m(2); 4 | ......^ 5 | 9 } 6 | -------------------------------------------------------------------------------- /test/less/errors/multiple-guards-on-css-selectors.less: -------------------------------------------------------------------------------- 1 | @ie8: true; 2 | .a when (@ie8 = true), 3 | .b { 4 | } -------------------------------------------------------------------------------- /test/less/errors/multiple-guards-on-css-selectors.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Guards are only currently allowed on a single selector. in {path}multiple-guards-on-css-selectors.less on line 3, column 1: 2 | 2 .a when (@ie8 = true), 3 | 3 .b { 4 | ..^ 5 | 4 } 6 | -------------------------------------------------------------------------------- /test/less/errors/multiple-guards-on-css-selectors2.less: -------------------------------------------------------------------------------- 1 | @ie8: true; 2 | .a, 3 | .b when (@ie8 = true) { 4 | } -------------------------------------------------------------------------------- /test/less/errors/multiple-guards-on-css-selectors2.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Guards are only currently allowed on a single selector. in {path}multiple-guards-on-css-selectors2.less on line 3, column 23: 2 | 2 .a, 3 | 3 .b when (@ie8 = true) { 4 | ........................^ 5 | 4 } 6 | -------------------------------------------------------------------------------- /test/less/errors/multiply-mixed-units.less: -------------------------------------------------------------------------------- 1 | /* Test */ 2 | #blah { 3 | // blah 4 | } 5 | .a { 6 | error: (1px * 1em); 7 | } -------------------------------------------------------------------------------- /test/less/errors/multiply-mixed-units.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Multiple units in dimension. Correct the units or use the unit function. Bad unit: em*px in {path}multiply-mixed-units.less on line 6, column 3: 2 | 5 .a { 3 | 6 error: (1px * 1em); 4 | ....^ 5 | 7 } 6 | -------------------------------------------------------------------------------- /test/less/errors/namespacing-2.less: -------------------------------------------------------------------------------- 1 | @dr: { 2 | nothing: here; 3 | }; 4 | 5 | .val { 6 | foo: @dr[not-found]; 7 | } -------------------------------------------------------------------------------- /test/less/errors/namespacing-2.txt: -------------------------------------------------------------------------------- 1 | NameError: property "not-found" not found in {path}namespacing-2.less on line 6, column 11: 2 | 5 .val { 3 | 6 foo: @dr[not-found]; 4 | ............^ 5 | 7 } 6 | -------------------------------------------------------------------------------- /test/less/errors/namespacing-3.less: -------------------------------------------------------------------------------- 1 | .theme() { 2 | foo: bar; 3 | } 4 | 5 | .val { 6 | @alias: .theme; // aliasing not allowed without () 7 | foo: @alias[foo]; 8 | } -------------------------------------------------------------------------------- /test/less/errors/namespacing-3.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Could not evaluate variable call @alias in {path}namespacing-3.less on line 7, column 3: 2 | 6 @alias: .theme; // aliasing not allowed without () 3 | 7 foo: @alias[foo]; 4 | ....^ 5 | 8 } 6 | -------------------------------------------------------------------------------- /test/less/errors/namespacing-4.less: -------------------------------------------------------------------------------- 1 | @dr: { 2 | nothing: here; 3 | }; 4 | 5 | .val { 6 | foo: @dr[@not-found]; 7 | } -------------------------------------------------------------------------------- /test/less/errors/namespacing-4.txt: -------------------------------------------------------------------------------- 1 | NameError: variable @not-found not found in {path}namespacing-4.less on line 6, column 11: 2 | 5 .val { 3 | 6 foo: @dr[@not-found]; 4 | ............^ 5 | 7 } 6 | -------------------------------------------------------------------------------- /test/less/errors/parens-error-1.less: -------------------------------------------------------------------------------- 1 | .a { 2 | something: (12 (13 + 5 -23) + 5); 3 | } -------------------------------------------------------------------------------- /test/less/errors/parens-error-1.txt: -------------------------------------------------------------------------------- 1 | ParseError: Expected ')' in {path}parens-error-1.less on line 2, column 18: 2 | 1 .a { 3 | 2 something: (12 (13 + 5 -23) + 5); 4 | ...................^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/parens-error-2.less: -------------------------------------------------------------------------------- 1 | .a { 2 | something: (12 * (13 + 5 -23)); 3 | } -------------------------------------------------------------------------------- /test/less/errors/parens-error-2.txt: -------------------------------------------------------------------------------- 1 | ParseError: Expected ')' in {path}parens-error-2.less on line 2, column 28: 2 | 1 .a { 3 | 2 something: (12 * (13 + 5 -23)); 4 | .............................^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/parens-error-3.less: -------------------------------------------------------------------------------- 1 | .a { 2 | something: (12 + (13 + 10 -23)); 3 | } -------------------------------------------------------------------------------- /test/less/errors/parens-error-3.txt: -------------------------------------------------------------------------------- 1 | ParseError: Expected ')' in {path}parens-error-3.less on line 2, column 29: 2 | 1 .a { 3 | 2 something: (12 + (13 + 10 -23)); 4 | ..............................^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/parse-error-curly-bracket.less: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fff; 3 | } 4 | } 5 | -------------------------------------------------------------------------------- /test/less/errors/parse-error-curly-bracket.txt: -------------------------------------------------------------------------------- 1 | ParseError: Unrecognised input. Possibly missing opening '{' in {path}parse-error-curly-bracket.less on line 4, column 1: 2 | 3 } 3 | 4 } 4 | ..^ 5 | 5 6 | -------------------------------------------------------------------------------- /test/less/errors/parse-error-media-no-block-1.less: -------------------------------------------------------------------------------- 1 | @media (extra: bracket)) { 2 | body { 3 | background-color: #fff; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/less/errors/parse-error-media-no-block-1.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: media definitions require block statements after any features in {path}parse-error-media-no-block-1.less on line 1, column 24: 2 | 1 @media (extra: bracket)) { 3 | .........................^ 4 | 2 body { 5 | -------------------------------------------------------------------------------- /test/less/errors/parse-error-media-no-block-2.less: -------------------------------------------------------------------------------- 1 | @media -------------------------------------------------------------------------------- /test/less/errors/parse-error-media-no-block-2.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: media definitions require block statements after any features in {path}parse-error-media-no-block-2.less on line 1, column 7: 2 | 1 @media 3 | ........^ 4 | -------------------------------------------------------------------------------- /test/less/errors/parse-error-media-no-block-3.less: -------------------------------------------------------------------------------- 1 | @media (min-width: 500px) { 2 | .sometimes-big { 3 | font-size: 5000px; 4 | } -------------------------------------------------------------------------------- /test/less/errors/parse-error-media-no-block-3.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: media definitions require block statements after any features in {path}parse-error-media-no-block-3.less on line 4, column 3: 2 | 3 font-size: 5000px; 3 | 4 } 4 | ....^ 5 | -------------------------------------------------------------------------------- /test/less/errors/parse-error-missing-bracket.less: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fff; 3 | -------------------------------------------------------------------------------- /test/less/errors/parse-error-missing-bracket.txt: -------------------------------------------------------------------------------- 1 | ParseError: Unrecognised input. Possibly missing something in {path}parse-error-missing-bracket.less on line 3, column 1: 2 | 2 background-color: #fff; 3 | 3 4 | ..^ 5 | -------------------------------------------------------------------------------- /test/less/errors/parse-error-missing-parens.less: -------------------------------------------------------------------------------- 1 | @media (missing: bracket { 2 | body { 3 | background-color: #fff; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/less/errors/parse-error-missing-parens.txt: -------------------------------------------------------------------------------- 1 | ParseError: Missing closing ')' in {path}parse-error-missing-parens.less on line 1, column 26: 2 | 1 @media (missing: bracket { 3 | ...........................^ 4 | 2 body { 5 | -------------------------------------------------------------------------------- /test/less/errors/parse-error-with-import.less: -------------------------------------------------------------------------------- 1 | @import 'import/import-test.less'; 2 | 3 | body 4 | { 5 | font-family: arial, sans-serif; 6 | } 7 | 8 | nonsense; 9 | 10 | .clickable 11 | { 12 | cursor: pointer; 13 | } -------------------------------------------------------------------------------- /test/less/errors/parse-error-with-import.txt: -------------------------------------------------------------------------------- 1 | ParseError: Unrecognised input in {path}parse-error-with-import.less on line 8, column 9: 2 | 7 3 | 8 nonsense; 4 | ..........^ 5 | 9 6 | -------------------------------------------------------------------------------- /test/less/errors/percentage-missing-space.less: -------------------------------------------------------------------------------- 1 | .a { 2 | error: calc(1 %); 3 | } -------------------------------------------------------------------------------- /test/less/errors/percentage-missing-space.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Invalid % without number in {path}percentage-missing-space.less on line 2, column 3: 2 | 1 .a { 3 | 2 error: calc(1 %); 4 | ....^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/percentage-non-number-argument.less: -------------------------------------------------------------------------------- 1 | div { 2 | percentage: percentage(16/17); 3 | } 4 | -------------------------------------------------------------------------------- /test/less/errors/percentage-non-number-argument.txt: -------------------------------------------------------------------------------- 1 | ArgumentError: error evaluating function `percentage`: argument must be a number in {path}percentage-non-number-argument.less on line 2, column 15: 2 | 1 div { 3 | 2 percentage: percentage(16/17); 4 | ................^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/percentage-non-number-argument.txt.bak: -------------------------------------------------------------------------------- 1 | ArgumentError: error evaluating function `percentage`: argument must be a number in {path}percentage-non-number-argument.less on line 2, column 15: 2 | 1 div { 3 | 2 percentage: percentage(16/17); 4 | 3 } 5 | -------------------------------------------------------------------------------- /test/less/errors/property-asterisk-only-name.less: -------------------------------------------------------------------------------- 1 | a { 2 | * : 1; 3 | } -------------------------------------------------------------------------------- /test/less/errors/property-asterisk-only-name.txt: -------------------------------------------------------------------------------- 1 | ParseError: Unrecognised input in {path}property-asterisk-only-name.less on line 2, column 7: 2 | 1 a { 3 | 2 * : 1; 4 | ........^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/property-ie5-hack.less: -------------------------------------------------------------------------------- 1 | .test { 2 | display/*/: block; /*sorry for IE5*/ 3 | } -------------------------------------------------------------------------------- /test/less/errors/property-ie5-hack.txt: -------------------------------------------------------------------------------- 1 | ParseError: Unrecognised input. Possibly missing opening '{' in {path}property-ie5-hack.less on line 3, column 1: 2 | 2 display/*/: block; /*sorry for IE5*/ 3 | 3 } 4 | ..^ 5 | -------------------------------------------------------------------------------- /test/less/errors/property-in-root.less: -------------------------------------------------------------------------------- 1 | .a() { 2 | prop:1; 3 | } 4 | .a(); -------------------------------------------------------------------------------- /test/less/errors/property-in-root.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Properties must be inside selector blocks. They cannot be in the root in {path}property-in-root.less on line 2, column 3: 2 | 1 .a() { 3 | 2 prop:1; 4 | ....^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/property-in-root2.less: -------------------------------------------------------------------------------- 1 | @import "property-in-root"; -------------------------------------------------------------------------------- /test/less/errors/property-in-root2.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Properties must be inside selector blocks. They cannot be in the root in {path}property-in-root.less on line 2, column 3: 2 | 1 .a() { 3 | 2 prop:1; 4 | ....^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/property-in-root3.less: -------------------------------------------------------------------------------- 1 | prop:1; 2 | .a { 3 | prop:1; 4 | } -------------------------------------------------------------------------------- /test/less/errors/property-in-root3.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Properties must be inside selector blocks. They cannot be in the root in {path}property-in-root3.less on line 1, column 1: 2 | 1 prop:1; 3 | ..^ 4 | 2 .a { 5 | -------------------------------------------------------------------------------- /test/less/errors/property-interp-not-defined.less: -------------------------------------------------------------------------------- 1 | a {outline-@{color}: green} -------------------------------------------------------------------------------- /test/less/errors/property-interp-not-defined.txt: -------------------------------------------------------------------------------- 1 | NameError: variable @color is undefined in {path}property-interp-not-defined.less on line 1, column 12: 2 | 1 a {outline-@{color}: green} 3 | .............^ 4 | -------------------------------------------------------------------------------- /test/less/errors/recursive-variable.less: -------------------------------------------------------------------------------- 1 | @bodyColor: darken(@bodyColor, 30%); -------------------------------------------------------------------------------- /test/less/errors/recursive-variable.txt: -------------------------------------------------------------------------------- 1 | NameError: Recursive variable definition for @bodyColor in {path}recursive-variable.less on line 1, column 20: 2 | 1 @bodyColor: darken(@bodyColor, 30%); 3 | .....................^ 4 | -------------------------------------------------------------------------------- /test/less/errors/root-func-undefined-1.less: -------------------------------------------------------------------------------- 1 | func(); -------------------------------------------------------------------------------- /test/less/errors/root-func-undefined-1.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Function 'func' is undefined in {path}root-func-undefined-1.less on line 1, column 1: 2 | 1 func(); 3 | ..^ 4 | -------------------------------------------------------------------------------- /test/less/errors/root-func-undefined-2.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-tree-nodes"; 2 | test-undefined(); 3 | -------------------------------------------------------------------------------- /test/less/errors/root-func-undefined-2.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: Function 'test-undefined' is undefined in {path}root-func-undefined-2.less on line 2, column 1: 2 | 1 @plugin "plugin-tree-nodes"; 3 | 2 test-undefined(); 4 | ..^ 5 | 3 6 | -------------------------------------------------------------------------------- /test/less/errors/single-character.less: -------------------------------------------------------------------------------- 1 | x -------------------------------------------------------------------------------- /test/less/errors/single-character.txt: -------------------------------------------------------------------------------- 1 | ParseError: Unrecognised input. Possibly missing something in {path}single-character.less on line 1, column 1: 2 | 1 x 3 | ..^ 4 | -------------------------------------------------------------------------------- /test/less/errors/svg-gradient1.less: -------------------------------------------------------------------------------- 1 | .a { 2 | a: svg-gradient(horizontal, black, white); 3 | } -------------------------------------------------------------------------------- /test/less/errors/svg-gradient1.txt: -------------------------------------------------------------------------------- 1 | ArgumentError: error evaluating function `svg-gradient`: svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center' in {path}svg-gradient1.less on line 2, column 6: 2 | 1 .a { 3 | 2 a: svg-gradient(horizontal, black, white); 4 | .......^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/svg-gradient2.less: -------------------------------------------------------------------------------- 1 | .a { 2 | a: svg-gradient(to bottom, black, orange, 45%, white); 3 | } -------------------------------------------------------------------------------- /test/less/errors/svg-gradient2.txt: -------------------------------------------------------------------------------- 1 | ArgumentError: error evaluating function `svg-gradient`: svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position] or direction, color list in {path}svg-gradient2.less on line 2, column 6: 2 | 1 .a { 3 | 2 a: svg-gradient(to bottom, black, orange, 45%, white); 4 | .......^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/svg-gradient3.less: -------------------------------------------------------------------------------- 1 | .a { 2 | a: svg-gradient(black, orange); 3 | } -------------------------------------------------------------------------------- /test/less/errors/svg-gradient3.txt: -------------------------------------------------------------------------------- 1 | ArgumentError: error evaluating function `svg-gradient`: svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position] or direction, color list in {path}svg-gradient3.less on line 2, column 6: 2 | 1 .a { 3 | 2 a: svg-gradient(black, orange); 4 | .......^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/svg-gradient4.less: -------------------------------------------------------------------------------- 1 | .a { 2 | a: svg-gradient(horizontal, @colors); 3 | } 4 | @colors: black, white; -------------------------------------------------------------------------------- /test/less/errors/svg-gradient4.txt: -------------------------------------------------------------------------------- 1 | ArgumentError: error evaluating function `svg-gradient`: svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center' in {path}svg-gradient4.less on line 2, column 6: 2 | 1 .a { 3 | 2 a: svg-gradient(horizontal, @colors); 4 | .......^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/svg-gradient5.less: -------------------------------------------------------------------------------- 1 | .a { 2 | a: svg-gradient(to bottom, @colors); 3 | } 4 | @colors: black, orange, 45%, white; -------------------------------------------------------------------------------- /test/less/errors/svg-gradient5.txt: -------------------------------------------------------------------------------- 1 | ArgumentError: error evaluating function `svg-gradient`: svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position] or direction, color list in {path}svg-gradient5.less on line 2, column 6: 2 | 1 .a { 3 | 2 a: svg-gradient(to bottom, @colors); 4 | .......^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/svg-gradient6.less: -------------------------------------------------------------------------------- 1 | .a { 2 | a: svg-gradient(black, @colors); 3 | } 4 | @colors: orange; -------------------------------------------------------------------------------- /test/less/errors/svg-gradient6.txt: -------------------------------------------------------------------------------- 1 | ArgumentError: error evaluating function `svg-gradient`: svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position] or direction, color list in {path}svg-gradient6.less on line 2, column 6: 2 | 1 .a { 3 | 2 a: svg-gradient(black, @colors); 4 | .......^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/errors/unit-function.less: -------------------------------------------------------------------------------- 1 | .a { 2 | font-size: unit(80/16,rem); 3 | } -------------------------------------------------------------------------------- /test/less/errors/unit-function.txt: -------------------------------------------------------------------------------- 1 | ArgumentError: error evaluating function `unit`: the first argument to unit must be a number. Have you forgotten parenthesis? in {path}unit-function.less on line 2, column 14: 2 | 1 .a { 3 | 2 font-size: unit(80/16,rem); 4 | ...............^ 5 | 3 } 6 | -------------------------------------------------------------------------------- /test/less/extend-clearfix.less: -------------------------------------------------------------------------------- 1 | .clearfix { 2 | *zoom: 1; 3 | &:after { 4 | content: ''; 5 | display: block; 6 | clear: both; 7 | height: 0; 8 | } 9 | } 10 | 11 | .foo { 12 | &:extend(.clearfix all); 13 | color: red; 14 | } 15 | 16 | .bar { 17 | &:extend(.clearfix all); 18 | color: blue; 19 | } 20 | -------------------------------------------------------------------------------- /test/less/extend-exact.less: -------------------------------------------------------------------------------- 1 | .replace.replace, 2 | .c.replace + .replace { 3 | .replace, 4 | .c { 5 | prop: copy-paste-replace; 6 | } 7 | } 8 | .rep_ace:extend(.replace.replace .replace) {} 9 | 10 | .a .b .c { 11 | prop: not_effected; 12 | } 13 | 14 | .a { 15 | prop: is_effected; 16 | .b { 17 | prop: not_effected; 18 | } 19 | .b.c { 20 | prop: not_effected; 21 | } 22 | } 23 | 24 | .c, .a { 25 | .b, .a { 26 | .a, .c { 27 | prop: not_effected; 28 | } 29 | } 30 | } 31 | 32 | .effected { 33 | &:extend(.a); 34 | &:extend(.b); 35 | &:extend(.c); 36 | } 37 | 38 | .e { 39 | && { 40 | prop: extend-double; 41 | &:hover { 42 | hover: not-extended; 43 | } 44 | } 45 | } 46 | .dbl:extend(.e.e) {} 47 | -------------------------------------------------------------------------------- /test/less/extend-media.less: -------------------------------------------------------------------------------- 1 | .ext1 .ext2 { 2 | background: black; 3 | } 4 | 5 | @media tv { 6 | .ext1 .ext3 { 7 | color: white; 8 | } 9 | .tv-lowres :extend(.ext1 all) { 10 | background: blue; 11 | } 12 | @media hires { 13 | .ext1 .ext4 { 14 | color: green; 15 | } 16 | .tv-hires :extend(.ext1 all) { 17 | background: red; 18 | } 19 | } 20 | } 21 | 22 | .all:extend(.ext1 all) { 23 | 24 | } -------------------------------------------------------------------------------- /test/less/extend-nest.less: -------------------------------------------------------------------------------- 1 | .sidebar { 2 | width: 300px; 3 | background: red; 4 | 5 | .box { 6 | background: #FFF; 7 | border: 1px solid #000; 8 | margin: 10px 0; 9 | } 10 | } 11 | 12 | .sidebar2 { 13 | &:extend(.sidebar all); 14 | background: blue; 15 | } 16 | 17 | .type1 { 18 | .sidebar3 { 19 | &:extend(.sidebar all); 20 | background: green; 21 | } 22 | } 23 | 24 | .type2 { 25 | &.sidebar4 { 26 | &:extend(.sidebar all); 27 | background: red; 28 | } 29 | } 30 | 31 | .button { 32 | color: black; 33 | &:hover { 34 | color: white; 35 | } 36 | } 37 | .submit { 38 | &:extend(.button); 39 | &:hover:extend(.button:hover) {} 40 | } 41 | 42 | .nomatch { 43 | &:hover:extend(.button :hover) {} 44 | } 45 | 46 | .button2 { 47 | :hover { 48 | nested: white; 49 | } 50 | } 51 | .button2 :hover { 52 | notnested: black; 53 | } 54 | 55 | .nomatch :extend(.button2:hover) {} 56 | 57 | .amp-test-a, 58 | .amp-test-b { 59 | .amp-test-c &.amp-test-d&.amp-test-e { 60 | .amp-test-f&+&.amp-test-g:extend(.amp-test-h) {} 61 | } 62 | } 63 | .amp-test-h { 64 | test: extended by masses of selectors; 65 | } -------------------------------------------------------------------------------- /test/less/extendedTest/apply.less: -------------------------------------------------------------------------------- 1 | @col: red; 2 | --polymer-mixin: { 3 | background-color: @col; 4 | } 5 | body { 6 | --foo: green; 7 | color: var(--foo, red); 8 | background-color: blue; 9 | @apply(--polymer-mixin); 10 | } 11 | -------------------------------------------------------------------------------- /test/less/extendedTest/colors.less: -------------------------------------------------------------------------------- 1 | #rgba { 2 | color: (#fea8 + #0101); 3 | } 4 | #rrggbbaa { 5 | color: (#ffeeaa88 + #0101); 6 | } 7 | #hsv { 8 | value1: hsvvalue(#f00); 9 | value2: hsvvalue(#0f0); 10 | value3: hsvvalue(#00f); 11 | } 12 | -------------------------------------------------------------------------------- /test/less/extendedTest/function-rem.less: -------------------------------------------------------------------------------- 1 | h2 { 2 | font-size: rem(32); 3 | } 4 | 5 | h3 { 6 | font-size: rem(16px); 7 | margin: rem(12pt); 8 | padding: rem(1em); 9 | } 10 | 11 | h4 { 12 | font-size: (32/16) * 1rem; 13 | } 14 | 15 | header { 16 | padding: rem(20) 0; 17 | font-size: rem(20, 20); 18 | } 19 | -------------------------------------------------------------------------------- /test/less/extendedTest/image-size.less: -------------------------------------------------------------------------------- 1 | #file-size-functions { 2 | bmp-size: image-size('../../data/image-size.bmp'); 3 | gif-size: image-size('../../data/image-size.gif'); 4 | jpg-size: image-size('../../data/image-size.jpg'); 5 | png-size: image-size('../../data/image-size.png'); 6 | psd-size: image-size('../../data/image-size.psd'); 7 | svg-size: image-size('../../data/image-size.svg'); 8 | webp-size1: image-size('../../data/image-size-lossless.webp'); 9 | webp-size2: image-size('../../data/image-size-lossy.webp'); 10 | } 11 | -------------------------------------------------------------------------------- /test/less/extendedTest/import-complex-path.less: -------------------------------------------------------------------------------- 1 | @import "../import/./novalue/../import-once-test-c.less"; 2 | -------------------------------------------------------------------------------- /test/less/extendedTest/import-package-lib.less: -------------------------------------------------------------------------------- 1 | @import "import-charset-test"; -------------------------------------------------------------------------------- /test/less/extendedTest/import-package.less: -------------------------------------------------------------------------------- 1 | //If lib/test/import-charset-test exists could use: 2 | //@import "packages/less_dart/test/import-charset-test"; 3 | //@import "package://less_dart/test/import-charset-test"; 4 | //Search for test/less/import/import-charset-test 5 | @import "package_test://less_dart/less/import/import-charset-test"; -------------------------------------------------------------------------------- /test/less/extendedTest/options-import.less: -------------------------------------------------------------------------------- 1 | @import "options-strict-math"; -------------------------------------------------------------------------------- /test/less/extendedTest/options-plugin.less: -------------------------------------------------------------------------------- 1 | @plugin "less-plugin-advanced-color-functions"; 2 | @import "plugin-advanced-color"; -------------------------------------------------------------------------------- /test/less/extendedTest/plugin-advanced-color.less: -------------------------------------------------------------------------------- 1 | .a { 2 | invertluma: invertluma(red); 3 | contrastmore: contrastmore(red, green, 1); 4 | autocontrast: autocontrast(blue, orange, 1); 5 | } -------------------------------------------------------------------------------- /test/less/extendedTest/svg.less: -------------------------------------------------------------------------------- 1 | #svg-functions { 2 | @colorlist1: black, white; 3 | background-image: svg-gradient(to bottom, @colorlist1); 4 | background-image: svg-gradient(to bottom, black white); 5 | background-image: svg-gradient(to bottom, black, orange 3%, white); 6 | @colorlist2: black, orange 3%, white; 7 | background-image: svg-gradient(to bottom, @colorlist2); 8 | @green_5: green 5%; 9 | @orange_percentage: 3%; 10 | @orange_color: orange; 11 | @colorlist3: (mix(black, white) + #444) 1%, @orange_color @orange_percentage, ((@green_5)), white 95%; 12 | background-image: svg-gradient(to bottom,@colorlist3); 13 | background-image: svg-gradient(to bottom, (mix(black, white) + #444) 1%, @orange_color @orange_percentage, ((@green_5)), white 95%); 14 | } -------------------------------------------------------------------------------- /test/less/extendedTest/url.less: -------------------------------------------------------------------------------- 1 | @import (inline) url('https://fonts.googleapis.com/css?family=Open+Sans:400,700|Montserrat:400,700'); 2 | //@import (inline) url('http://lesscss.org/public/css/index.css'); 3 | -------------------------------------------------------------------------------- /test/less/filemanagerPlugin/colors.test: -------------------------------------------------------------------------------- 1 | @color: red; 2 | -------------------------------------------------------------------------------- /test/less/filemanagerPlugin/filemanager.less: -------------------------------------------------------------------------------- 1 | @import "test.test"; 2 | .test { 3 | color: @color; 4 | } 5 | -------------------------------------------------------------------------------- /test/less/globalVars/extended.json: -------------------------------------------------------------------------------- 1 | { 2 | "the-border": "1px", 3 | "base-color": "#111", 4 | "red": "#842210" 5 | } -------------------------------------------------------------------------------- /test/less/globalVars/extended.less: -------------------------------------------------------------------------------- 1 | #header { 2 | color: (@base-color * 3); 3 | border-left: @the-border; 4 | border-right: (@the-border * 2); 5 | } 6 | #footer { 7 | color: (@base-color + #003300); 8 | border-color: @red; 9 | } 10 | @red: desaturate(red, 10%); // less file overrides passed in color <- note line comment on last line to check it is okay -------------------------------------------------------------------------------- /test/less/globalVars/simple.json: -------------------------------------------------------------------------------- 1 | { 2 | "my-color": "red" 3 | } -------------------------------------------------------------------------------- /test/less/globalVars/simple.less: -------------------------------------------------------------------------------- 1 | .class { 2 | color: @my-color; 3 | } -------------------------------------------------------------------------------- /test/less/ie-filters.less: -------------------------------------------------------------------------------- 1 | @fat: 0; 2 | @cloudhead: "#000000"; 3 | 4 | .nav { 5 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity = 20); 6 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=@fat); 7 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#333333", endColorstr=@cloudhead, GradientType=@fat); 8 | } 9 | .evalTest(@arg) { 10 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=@arg); 11 | } 12 | .evalTest1 { 13 | .evalTest(30); 14 | .evalTest(5); 15 | } -------------------------------------------------------------------------------- /test/less/import-absolute-path.less: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | @import "{pathabs}/import/import-charset-test"; -------------------------------------------------------------------------------- /test/less/import-inline.less: -------------------------------------------------------------------------------- 1 | @import url("import/import-test-c.less");// import inline should not float above this #1954 2 | @import (inline) url("import/import-test-d.css") (min-width:600px); 3 | @import (inline, css) url("import/invalid-css.less"); -------------------------------------------------------------------------------- /test/less/import-interpolation.less: -------------------------------------------------------------------------------- 1 | @my_theme: "test"; 2 | 3 | @import "import/import-@{my_theme}-e.less"; 4 | 5 | @import "import/import-@{in}@{terpolation}.less"; 6 | 7 | @import "import/interpolation-vars.less"; 8 | 9 | -------------------------------------------------------------------------------- /test/less/import-once.less: -------------------------------------------------------------------------------- 1 | @import "import/import-once-test-c"; 2 | @import "import/import-once-test-c"; 3 | @import "import/import-once-test-c.less"; 4 | @import "import/deeper/import-once-test-a"; 5 | @import (multiple) "import/import-test-f.less"; 6 | @import (multiple) "import/import-test-f.less"; -------------------------------------------------------------------------------- /test/less/import-packages/test.less: -------------------------------------------------------------------------------- 1 | :host { 2 | //just empty file 3 | } -------------------------------------------------------------------------------- /test/less/import-reference-issues/appender-reference-1968.less: -------------------------------------------------------------------------------- 1 | .container-no-parent-selector { 2 | .mixin-no-parent-selector(); 3 | } 4 | .container-with-parent-selector { 5 | .mixin-with-parent-selector() 6 | } 7 | -------------------------------------------------------------------------------- /test/less/import-reference-issues/global-scope-import.less: -------------------------------------------------------------------------------- 1 | .theOnlySelector { 2 | avoid: warning; 3 | } 4 | .unusedAndReference:extend(.theOnlySelector) { 5 | unused-and: reference; 6 | } 7 | 8 | @import (reference) "global-scope-nested.less"; 9 | 10 | .test-b { 11 | background-color: green; 12 | &:extend(.test-a all); 13 | } 14 | -------------------------------------------------------------------------------- /test/less/import-reference-issues/global-scope-nested.less: -------------------------------------------------------------------------------- 1 | .test-a { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /test/less/import-reference-issues/mixin-1968.less: -------------------------------------------------------------------------------- 1 | .mixin-no-parent-selector() { 2 | background-color: red; 3 | } 4 | .mixin-with-parent-selector() { 5 | &:first-child{ // USING AN & SELECTOR HERE 6 | background-color: blue; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/less/import-reference-issues/multiple-import-nested.less: -------------------------------------------------------------------------------- 1 | /* double nested file */ 2 | should { 3 | be: invisible; 4 | } 5 | /* do not extend outside of this */ 6 | .something { 7 | invisible: suppress warning; 8 | } 9 | .invisible { 10 | &:extend(.something all); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /test/less/import-reference-issues/multiple-import.less: -------------------------------------------------------------------------------- 1 | /* 2 | tralala 3 | */ 4 | .fix { 5 | fix: fix; 6 | } 7 | .something { 8 | @import (reference) "multiple-import-nested.less"; 9 | inside: something; 10 | } 11 | -------------------------------------------------------------------------------- /test/less/import-reference-issues/simple-mixin.css: -------------------------------------------------------------------------------- 1 | .mixin { 2 | was: included; 3 | } 4 | -------------------------------------------------------------------------------- /test/less/import-reference-issues/simple-ruleset-2162.less: -------------------------------------------------------------------------------- 1 | ruleset { 2 | shall-be-invisible: less; 3 | } 4 | -------------------------------------------------------------------------------- /test/less/import-reference.less: -------------------------------------------------------------------------------- 1 | @import (reference) url("import-once.less"); 2 | @import (reference) url("css-3.less"); 3 | @import (reference) url("media.less"); 4 | @import (reference) url("import/import-reference.less"); 5 | @import (reference) url("import/css-import.less"); 6 | 7 | .b { 8 | .z(); 9 | } 10 | 11 | .zz(); 12 | 13 | .visible:extend(.z all) { 14 | extend: test; 15 | } 16 | 17 | .test-mediaq-import { 18 | .mixin-with-mediaq(340px); 19 | } 20 | 21 | .class:extend(.class all) { 22 | } 23 | .mixin-with-nested-selectors(); 24 | .mixin-with-directives(some-name); 25 | 26 | .print-referenced-import-inline(); 27 | -------------------------------------------------------------------------------- /test/less/import.less: -------------------------------------------------------------------------------- 1 | /** comment at the top**/ 2 | @import url(/absolute/something.css) screen and (color) and (max-width: 600px); 3 | 4 | @import (optional) "file-does-not-exist.does-not-exist"; 5 | 6 | @var: 100px; 7 | @import url("//ha.com/file.css") (min-width:@var); 8 | 9 | #import-test { 10 | .mixin; 11 | width: 10px; 12 | height: (@a + 10%); 13 | } 14 | @import "import/import-test-e" screen and (max-width: 600px); 15 | 16 | @import url("import/import-test-a.less"); 17 | 18 | @import (less, multiple) "import/import-test-d.css" screen and (max-width: 601px); 19 | 20 | @import (multiple) "import/import-test-e" screen and (max-width: 602px); 21 | 22 | @import (less, multiple) url("import/import-test-d.css") screen and (max-width: 603px); 23 | 24 | @media print { 25 | @import (multiple) "import/import-test-e"; 26 | } 27 | 28 | @charset "UTF-8"; // climb on top #2126 29 | -------------------------------------------------------------------------------- /test/less/import/css-import.less: -------------------------------------------------------------------------------- 1 | @import url("test.css"); 2 | -------------------------------------------------------------------------------- /test/less/import/deeper/deeper-2/url-import-2.less: -------------------------------------------------------------------------------- 1 | .deep-import-url { 2 | color: red; 3 | } -------------------------------------------------------------------------------- /test/less/import/deeper/deeper-2/url-import.less: -------------------------------------------------------------------------------- 1 | @import url("url-import-2.less"); -------------------------------------------------------------------------------- /test/less/import/deeper/import-once-test-a.less: -------------------------------------------------------------------------------- 1 | @import "../import-once-test-c"; -------------------------------------------------------------------------------- /test/less/import/deeper/url-import.less: -------------------------------------------------------------------------------- 1 | @import url("deeper-2/url-import.less"); -------------------------------------------------------------------------------- /test/less/import/import-and-relative-paths-test.less: -------------------------------------------------------------------------------- 1 | @import "../css/background.css"; 2 | @import "import-test-d.css"; 3 | 4 | @import "imports/logo"; 5 | @import "imports/font"; 6 | 7 | .unquoted-relative-path-bg() { 8 | background-image: url(../../data/image.jpg); 9 | } 10 | .quoted-relative-path-border-image() { 11 | border-image: url('../../data/image.jpg'); 12 | } 13 | 14 | #imported-relative-path { 15 | .unquoted-relative-path-bg; 16 | .quoted-relative-path-border-image; 17 | } -------------------------------------------------------------------------------- /test/less/import/import-charset-test.less: -------------------------------------------------------------------------------- 1 | @charset "ISO-8859-1"; -------------------------------------------------------------------------------- /test/less/import/import-inline-invalid-css.less: -------------------------------------------------------------------------------- 1 | @import (inline) "invalid-css.less"; -------------------------------------------------------------------------------- /test/less/import/import-interpolation.less: -------------------------------------------------------------------------------- 1 | @import (inline) "imports/logo.less"; 2 | @import "import-@{in}@{terpolation}2.less"; -------------------------------------------------------------------------------- /test/less/import/import-interpolation2.less: -------------------------------------------------------------------------------- 1 | .a { 2 | var: test; 3 | } 4 | 5 | @in: "redefined-does-nothing"; -------------------------------------------------------------------------------- /test/less/import/import-once-test-c.less: -------------------------------------------------------------------------------- 1 | 2 | @c: red; 3 | 4 | #import { 5 | color: @c; 6 | } 7 | -------------------------------------------------------------------------------- /test/less/import/import-test-a.less: -------------------------------------------------------------------------------- 1 | @import "import-test-b.less"; 2 | @import url(import-test-f.less); 3 | @import url("deeper/url-import.less"); 4 | @a: 20%; 5 | @import "urls.less"; -------------------------------------------------------------------------------- /test/less/import/import-test-b.less: -------------------------------------------------------------------------------- 1 | @import "import-test-c"; 2 | 3 | @b: 100%; 4 | 5 | .mixin { 6 | height: 10px; 7 | color: @c; 8 | } 9 | -------------------------------------------------------------------------------- /test/less/import/import-test-c.less: -------------------------------------------------------------------------------- 1 | 2 | @c: red; 3 | 4 | #import { 5 | color: @c; 6 | } 7 | -------------------------------------------------------------------------------- /test/less/import/import-test-d.css: -------------------------------------------------------------------------------- 1 | #css { color: yellow; } 2 | -------------------------------------------------------------------------------- /test/less/import/import-test-e.less: -------------------------------------------------------------------------------- 1 | 2 | body { width: 100% } 3 | -------------------------------------------------------------------------------- /test/less/import/import-test-f.less: -------------------------------------------------------------------------------- 1 | @import "import-test-e"; 2 | 3 | .test-f { 4 | height: 10px; 5 | } 6 | -------------------------------------------------------------------------------- /test/less/import/imports/font.less: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: xecret; 3 | src: url('../assets/xecret.ttf'); 4 | } 5 | 6 | #secret { 7 | font-family: xecret, sans-serif; 8 | } 9 | -------------------------------------------------------------------------------- /test/less/import/imports/logo.less: -------------------------------------------------------------------------------- 1 | #logo { 2 | width: 100px; 3 | height: 100px; 4 | background: url('../assets/logo.png'); 5 | background: url("#inline-svg"); 6 | } 7 | -------------------------------------------------------------------------------- /test/less/import/interpolation-vars.less: -------------------------------------------------------------------------------- 1 | @in: "in"; 2 | @terpolation: "terpolation"; 3 | 4 | // should be ignored because its already imported 5 | // and it uses a variable from the parent scope 6 | @import "import-@{my_theme}-e.less"; 7 | -------------------------------------------------------------------------------- /test/less/import/invalid-css.less: -------------------------------------------------------------------------------- 1 | this isn't very valid CSS. -------------------------------------------------------------------------------- /test/less/import/urls.less: -------------------------------------------------------------------------------- 1 | // empty file showing that it loads from the relative path first 2 | -------------------------------------------------------------------------------- /test/less/include-path-string/include-path-string.less: -------------------------------------------------------------------------------- 1 | data-uri { 2 | property: data-uri('image.svg'); 3 | } 4 | -------------------------------------------------------------------------------- /test/less/include-path/include-path.less: -------------------------------------------------------------------------------- 1 | @import "import-test-e"; 2 | 3 | data-uri { 4 | property: data-uri('image.svg'); 5 | } 6 | image-size { 7 | property: image-size('image.svg'); 8 | } 9 | -------------------------------------------------------------------------------- /test/less/javascript.less: -------------------------------------------------------------------------------- 1 | .eval { 2 | js: `42`; 3 | js: `1 + 1`; 4 | js: `"hello world"`; 5 | js: `[1, 2, 3]`; 6 | title: `typeof process.title`; 7 | ternary: `(1 + 1 == 2 ? true : false)`; 8 | multiline: `(function(){var x = 1 + 1; 9 | return x})()`; 10 | } 11 | .scope { 12 | empty: `+function(){}`; 13 | @foo: 42; 14 | var: `parseInt(this.foo.toJS())`; 15 | escaped: ~`2 + 5 + 'px'`; 16 | } 17 | .vars { 18 | @var: `4 + 4`; 19 | width: @var; 20 | } 21 | .escape-interpol { 22 | @world: "world"; 23 | width: ~`"hello" + " " + @{world}`; 24 | } 25 | .arrays { 26 | @ary: 1, 2, 3; 27 | @ary2: 1 2 3; 28 | ary: `@{ary}.join(', ')`; 29 | ary1: `@{ary2}.join(', ')`; 30 | } 31 | .transitions(...) { 32 | @arg: ~`"@{arguments}".replace(/[\[\]]*/g, '')`; 33 | 1: @arg; // rounded to integers 34 | 2: ~`"@{arguments}"`; // rounded to integers 35 | 3: @arguments; // OK 36 | } 37 | .test-tran { 38 | .transitions(opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear;); 39 | } 40 | -------------------------------------------------------------------------------- /test/less/lazy-eval.less: -------------------------------------------------------------------------------- 1 | @var: @a; 2 | @a: 100%; 3 | 4 | .lazy-eval { 5 | width: @var; 6 | } 7 | -------------------------------------------------------------------------------- /test/less/legacy/legacy.less: -------------------------------------------------------------------------------- 1 | @media (-o-min-device-pixel-ratio: 2) { 2 | .test-math-and-units { 3 | font: ignores 0/0 rules; 4 | test-division: 4 / 2 + 5em; 5 | simple: 1px + 1px; 6 | } 7 | } 8 | #units { 9 | t1: (2em/1em) + 20; 10 | t2: 20 + (2em/1em); 11 | t3: 2em/1em; 12 | t4: (2em/1px) + 20; 13 | t5: 20 + (2em/1px); 14 | t6: 2em/1px; 15 | t7: (2em*1em) + 20; 16 | t8: 20 + (2em*1em); 17 | t9: 2em*1em; 18 | t10: (2em*1px) + 20; 19 | t11: 20 + (2em*1px); 20 | t12: 2em*1px; 21 | } 22 | -------------------------------------------------------------------------------- /test/less/math/parens-division/media-math.less: -------------------------------------------------------------------------------- 1 | @var: 16; 2 | 3 | @media (min-width: @var + 1) { 4 | .foo { bar: 1; } 5 | } 6 | 7 | @media (min-width: @var / 9) { 8 | .foo { bar: 1; } 9 | } -------------------------------------------------------------------------------- /test/less/math/parens-division/new-division.less: -------------------------------------------------------------------------------- 1 | .units { 2 | font: 1.2rem/2rem; 3 | font: 8vw/9vw; 4 | font: 10vh/12vh; 5 | font: 12vm/15vm; 6 | font: 12vmin/15vmin; 7 | font: 1.2ch/1.5ch; 8 | } 9 | 10 | .math { 11 | a: 1 + 1; 12 | b: 2px / 2; 13 | c: 2px ./ 2; 14 | d: (10px / 10px); 15 | e: ((16px ./ 2) / 2) / 2; 16 | f: ((16px ./ 2) / 2) ./ 2; 17 | } 18 | -------------------------------------------------------------------------------- /test/less/math/strict-legacy/media-math.less: -------------------------------------------------------------------------------- 1 | @var: 16; 2 | 3 | @media (min-width: @var + 1) { 4 | .foo { bar: 1; } 5 | } 6 | 7 | @media (min-width: @var / 9) { 8 | .foo { bar: 1; } 9 | } -------------------------------------------------------------------------------- /test/less/math/strict/media-math.less: -------------------------------------------------------------------------------- 1 | @var: 16; 2 | 3 | @media (min-width: @var + 1) { 4 | .foo { bar: 1; } 5 | } 6 | 7 | @media (min-width: @var / 9) { 8 | .foo { bar: 1; } 9 | } -------------------------------------------------------------------------------- /test/less/mixins-closure.less: -------------------------------------------------------------------------------- 1 | .scope { 2 | @var: 99px; 3 | .mixin () { 4 | width: @var; 5 | } 6 | } 7 | 8 | .class { 9 | .scope > .mixin; 10 | } 11 | 12 | .overwrite { 13 | @var: 0px; 14 | .scope > .mixin; 15 | } 16 | 17 | .nested { 18 | @var: 5px; 19 | .mixin () { 20 | width: @var; 21 | } 22 | .class { 23 | @var: 10px; 24 | .mixin; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/less/mixins-important.less: -------------------------------------------------------------------------------- 1 | .submixin(@a) { 2 | border-width: @a; 3 | } 4 | .mixin (9) { 5 | border: 9 !important; 6 | } 7 | .mixin (@a: 0) { 8 | border: @a; 9 | boxer: @a; 10 | .inner { 11 | test: @a; 12 | } 13 | // comment 14 | .submixin(@a); 15 | } 16 | 17 | .class { 18 | .mixin(1); 19 | .mixin(2) !important; 20 | .mixin(3); 21 | .mixin(4) !important; 22 | .mixin(5); 23 | .mixin !important; 24 | .mixin(9); 25 | } 26 | .size(@aaa: auto) { 27 | .set-width(@aaa) { 28 | width: @aaa; 29 | } 30 | .set-width(@aaa); 31 | } 32 | .when-calling-nested-issue-2394 { 33 | .size() !important; 34 | } 35 | .when-calling-nested-with-param-issue-2394 { 36 | .size(10px) !important; 37 | } 38 | .testMixin-2421 () { 39 | .topCheck-2421 () { 40 | .nestedCheck-2421() { 41 | margin: 5px; 42 | } 43 | .nestedCheck-2421(); 44 | } 45 | .topCheck-2421(); 46 | } 47 | .class1-2421 { 48 | .testMixin-2421() !important; 49 | } 50 | .class2-2421 { 51 | .testMixin-2421(); 52 | } 53 | 54 | -------------------------------------------------------------------------------- /test/less/mixins-interpolated.less: -------------------------------------------------------------------------------- 1 | 2 | @a0: 123; 3 | @a1: foo; 4 | @a2: ~".foo"; 5 | @a4: ~"#foo"; 6 | 7 | .@{a0} { 8 | a: 0; 9 | } 10 | 11 | .@{a1} { 12 | a: 1; 13 | } 14 | 15 | @{a2} { 16 | a: 2; 17 | } 18 | 19 | #@{a1} { 20 | a: 3; 21 | } 22 | 23 | @{a4} { 24 | a: 4; 25 | } 26 | 27 | mi-test-a { 28 | .123; 29 | .foo; 30 | #foo; 31 | } 32 | 33 | .b .bb { 34 | &.@{a1}-xxx .yyy-@{a1}@{a4} { 35 | & @{a2}.bbb { 36 | b: 1; 37 | } 38 | } 39 | } 40 | 41 | mi-test-b { 42 | .b.bb.foo-xxx.yyy-foo#foo.foo.bbb; 43 | } 44 | 45 | @c1: @a1; 46 | @c2: bar; 47 | @c3: baz; 48 | 49 | #@{c1}-foo { 50 | > .@{c2} { 51 | .@{c3} { 52 | c: c; 53 | } 54 | } 55 | } 56 | 57 | mi-test-c { 58 | &-1 {#foo-foo;} 59 | &-2 {#foo-foo > .bar;} 60 | &-3 {#foo-foo > .bar.baz;} 61 | } 62 | 63 | .Person(@name, @gender_) { 64 | .@{name} { 65 | @gender: @gender_; 66 | .sayGender() { 67 | gender: @gender; 68 | } 69 | } 70 | } 71 | 72 | mi-test-d { 73 | .Person(person, "Male"); 74 | .person.sayGender(); 75 | } 76 | -------------------------------------------------------------------------------- /test/less/mixins-named-args.less: -------------------------------------------------------------------------------- 1 | .mixin (@a: 1px, @b: 50%) { 2 | width: (@a * 5); 3 | height: (@b - 1%); 4 | args: @arguments; 5 | } 6 | .mixin (@a: 1px, @b: 50%) when (@b > 75%){ 7 | text-align: center; 8 | } 9 | 10 | .named-arg { 11 | color: blue; 12 | .mixin(@b: 100%); 13 | } 14 | 15 | .class { 16 | @var: 20%; 17 | .mixin(@b: @var); 18 | } 19 | 20 | .all-args-wrong-args { 21 | .mixin(@b: 10%, @a: 2px); 22 | } 23 | 24 | .mixin2 (@a: 1px, @b: 50%, @c: 50) { 25 | width: (@a * 5); 26 | height: (@b - 1%); 27 | color: (#000000 + @c); 28 | } 29 | 30 | .named-args2 { 31 | .mixin2(3px, @c: 100); 32 | } 33 | 34 | .named-args3 { 35 | .mixin2(@b: 30%, @c: #123456); 36 | } -------------------------------------------------------------------------------- /test/less/mixins-nested.less: -------------------------------------------------------------------------------- 1 | .mix-inner (@var) { 2 | border-width: @var; 3 | } 4 | 5 | .mix (@a: 10) { 6 | .inner { 7 | height: (@a * 10); 8 | 9 | .innest { 10 | width: @a; 11 | .mix-inner((@a * 2)); 12 | } 13 | } 14 | } 15 | 16 | .class { 17 | .mix(30); 18 | } 19 | 20 | .class2 { 21 | .mix(60); 22 | } 23 | -------------------------------------------------------------------------------- /test/less/modifyVars/extended.json: -------------------------------------------------------------------------------- 1 | { 2 | "the-border": "1px", 3 | "base-color": "#111", 4 | "red": "#842210" 5 | } -------------------------------------------------------------------------------- /test/less/modifyVars/extended.less: -------------------------------------------------------------------------------- 1 | #header { 2 | color: (@base-color * 3); 3 | border-left: @the-border; 4 | border-right: (@the-border * 2); 5 | } 6 | #footer { 7 | color: (@base-color + #003300); 8 | border-color: @red; 9 | } 10 | @red: blue; // var is overridden by the modifyVars 11 | //@base-color: green; -------------------------------------------------------------------------------- /test/less/namespacing/imports/a-better-bootstrap.less: -------------------------------------------------------------------------------- 1 | #theme() { 2 | .light() {} //... 3 | .dark() { 4 | // ... 5 | .navbar() { 6 | .colors() { 7 | primary: blue; 8 | secondary: lightblue; 9 | } 10 | } 11 | // ... 12 | } 13 | } -------------------------------------------------------------------------------- /test/less/namespacing/imports/library.less: -------------------------------------------------------------------------------- 1 | 2 | // I am a library 3 | #library { 4 | .sizes() { 5 | @width: 600px; 6 | } 7 | .add-one(@val) { 8 | @return: @val + 1px; 9 | } 10 | .sizes(@test) when (@test = true) { 11 | @width: 400px; 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /test/less/namespacing/namespacing-1.less: -------------------------------------------------------------------------------- 1 | @varToGet: default-color; 2 | .foo { 3 | color1: @defaults[@default-color]; 4 | color2: @defaults[@nested][@color]; 5 | color3: @theme[color]; 6 | color4: @theme[@nested][color]; 7 | color5: @defaults[@@varToGet]; 8 | prop: #ns1[foo]; 9 | var: #ns1[@foo]; 10 | sub: #ns1.vars[$sub]; 11 | } 12 | 13 | @defaults: { 14 | @default-color: red; 15 | @nested: { 16 | @color: yellow; 17 | } 18 | }; 19 | 20 | @theme: { 21 | color: red; 22 | @nested: { 23 | color: yellow; 24 | } 25 | }; 26 | 27 | #ns1 { 28 | foo: bar; 29 | @foo: baz; 30 | .vars() { 31 | sub: value; 32 | } 33 | } 34 | 35 | // Test that it matches more than one mixin 36 | #ns1 { 37 | foo: uno; 38 | @foo: dos; 39 | .vars() { 40 | sub: tres; 41 | } 42 | } 43 | 44 | // https://github.com/less/less.js/issues/3346 45 | #DEF() { 46 | .colors() { primary: grey; } 47 | } 48 | 49 | .button { 50 | color: #DEF.colors[primary]; 51 | border-color: #AAA #CCC; 52 | } 53 | -------------------------------------------------------------------------------- /test/less/namespacing/namespacing-2.less: -------------------------------------------------------------------------------- 1 | @import "imports/library.less"; 2 | 3 | .bar { 4 | width: #library.sizes[@width]; 5 | height: #library.add-one(1px)[@return]; 6 | } 7 | 8 | // I'm gonna override some values 9 | #library { 10 | .sizes() { 11 | @width: 800px; 12 | } 13 | } 14 | 15 | .foo { 16 | width: #library.sizes[@width]; 17 | } 18 | 19 | .foods() { 20 | @dessert: ice cream; 21 | } 22 | 23 | @key-to-lookup: dessert; 24 | 25 | .lunch { 26 | treat: .foods[@@key-to-lookup]; 27 | } 28 | -------------------------------------------------------------------------------- /test/less/namespacing/namespacing-3.less: -------------------------------------------------------------------------------- 1 | @map: { 2 | @width: 400px; 3 | @colors: { 4 | toolbar-background: red; 5 | toolbar-foreground: white; 6 | } 7 | }; 8 | 9 | #ns { 10 | .mixin() { 11 | @height: 200px; 12 | } 13 | } 14 | 15 | @breakpoints: { 16 | mobile: 320px; 17 | tablet: 768px; 18 | desktop: 1024px; 19 | }; 20 | 21 | @media (min-width: @breakpoints[mobile]) { 22 | .toolbar { 23 | width: @map[@width]; 24 | height: #ns.mixin[@height]; 25 | background: @map[@colors][toolbar-background]; 26 | color: @map[@colors][toolbar-foreground]; 27 | } 28 | } 29 | 30 | // !important after map usage 31 | // https://github.com/less/less.js/issues/3430 32 | @margins: { 33 | zero: 0; 34 | ten: 10px; 35 | } 36 | .cell { 37 | margin: @margins[zero] @margins[ten]/2 !important; 38 | } 39 | 40 | .mixin(@color: black; @margin: 10px; @padding: 20px) { 41 | color: @color; 42 | margin: @margin; 43 | padding: @padding; 44 | width: @margins[zero] !important 45 | } 46 | .class1 { 47 | .mixin(@margin: 20px; @color: #33acfe) !important; 48 | } 49 | .class2 { 50 | .mixin(#efca44; @padding: 40px 10px); 51 | } 52 | -------------------------------------------------------------------------------- /test/less/namespacing/namespacing-4.less: -------------------------------------------------------------------------------- 1 | #ns { 2 | .mixin(@a) when (@a = 1) { 3 | @a: 20px; 4 | } 5 | } 6 | 7 | .alias() { 8 | #ns.mixin(1); 9 | } 10 | 11 | #library { 12 | .core() { 13 | .colors() { 14 | primary: blue; 15 | foreground: white; 16 | } 17 | } 18 | } 19 | 20 | #library { 21 | .core() { 22 | .colors() { 23 | primary: rebeccapurple; 24 | } 25 | } 26 | } 27 | 28 | .foo { 29 | .colors() { #library.core.colors; } 30 | width: .alias[@a]; 31 | background: .colors[primary]; 32 | color: .colors[foreground]; 33 | } -------------------------------------------------------------------------------- /test/less/namespacing/namespacing-5.less: -------------------------------------------------------------------------------- 1 | @import "imports/a-better-bootstrap"; 2 | 3 | #theme.dark.navbar { 4 | .colors() { 5 | primary: rebeccapurple; 6 | } 7 | .colors(dark) { 8 | primary: black; 9 | secondary: grey; 10 | } 11 | .test() { 12 | val: output; 13 | } 14 | } 15 | 16 | .my-navbar { 17 | #theme.dark.navbar(); 18 | background: .colors[primary]; 19 | .test(); 20 | } 21 | 22 | .another-navbar { 23 | @colors: #theme.dark.navbar.colors() !important; 24 | background: @colors[primary]; 25 | border: 1px solid @colors[secondary]; 26 | } 27 | 28 | .another { 29 | @colors: #theme.dark.navbar.colors(dark); 30 | background: @colors[primary]; 31 | border: 1px solid @colors[secondary]; 32 | } -------------------------------------------------------------------------------- /test/less/namespacing/namespacing-6.less: -------------------------------------------------------------------------------- 1 | .wrapper(@another-mixin) { 2 | @another-mixin(); 3 | } 4 | 5 | .something(foo) { 6 | width: 10px; 7 | } 8 | 9 | .output-height() { 10 | height: 10px; 11 | } 12 | 13 | .rule-1 { 14 | @alias: .something(foo); 15 | @alias(); 16 | } 17 | 18 | .rule-2 { 19 | @alias: .something(foo); 20 | .wrapper(@alias); 21 | } 22 | 23 | .rule-3 { 24 | .wrapper(.something(foo)); 25 | .wrapper(.output-height()); 26 | } -------------------------------------------------------------------------------- /test/less/namespacing/namespacing-7.less: -------------------------------------------------------------------------------- 1 | #ns { 2 | .options() { 3 | option: true; 4 | } 5 | } 6 | 7 | @ns: { 8 | @options: { 9 | option: true; 10 | }; 11 | }; 12 | 13 | & when (#ns.options[option]) { 14 | .output { 15 | a: b; 16 | } 17 | } 18 | 19 | & when (#ns.options[option] = true) { 20 | .output-2 { 21 | c: d; 22 | } 23 | } 24 | 25 | & when (#ns.options[option] = false) { 26 | .no-reach { 27 | c: d; 28 | } 29 | } 30 | 31 | // DR access 32 | & when (@ns[@options][option]) { 33 | .dr { 34 | a: b; 35 | } 36 | } 37 | 38 | & when (@ns[@options][option] = true) { 39 | .dr-2 { 40 | c: d; 41 | } 42 | } 43 | 44 | & when (@ns[@options][option] = false) { 45 | .dr-no-reach { 46 | c: d; 47 | } 48 | } -------------------------------------------------------------------------------- /test/less/namespacing/namespacing-functions.less: -------------------------------------------------------------------------------- 1 | .add(@a, @b) { 2 | @r: @a + @b; 3 | } 4 | .foo { 5 | width: .add(10px, 10px)[]; 6 | bar: @return[]; 7 | } 8 | 9 | @return: { 10 | single: val; 11 | } 12 | 13 | // Issue #3405 14 | #lookup { 15 | @prop: test; 16 | } 17 | 18 | .mix (@var) { 19 | width: @var; 20 | } 21 | 22 | .bar { 23 | .mix(#lookup[@prop]); 24 | } 25 | 26 | // Issue #3406 27 | .mix2 (@n) { 28 | value: @n; 29 | } 30 | #lookup2 { 31 | @var: .mix2(lookup); 32 | } 33 | .example { 34 | // #lookup[@var](); -- fails, need the following alias 35 | @dr: #lookup2[@var]; 36 | @dr(); 37 | } 38 | -------------------------------------------------------------------------------- /test/less/namespacing/namespacing-media.less: -------------------------------------------------------------------------------- 1 | #ns { 2 | .sizes() { 3 | @small: 600px; 4 | } 5 | .breakpoint(@size) { 6 | @val: #ns.sizes[@@size]; 7 | @min: (min-width: @val); 8 | @max: not all and @min; 9 | } 10 | } 11 | 12 | #ns { 13 | .sizes() { 14 | @small: 480px; 15 | } 16 | } 17 | 18 | .valToGet() { 19 | keyword: small; 20 | } 21 | 22 | @media #ns.breakpoint(.valToGet[])[@max] { 23 | .selector { 24 | prop: val; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/less/namespacing/namespacing-operations.less: -------------------------------------------------------------------------------- 1 | #ns { 2 | .options() { 3 | val1: 10px; 4 | } 5 | } 6 | 7 | @ns: { 8 | @options: { 9 | val2: 20px; 10 | } 11 | } 12 | 13 | .foo { 14 | val: #ns.options[val1] + @ns[@options][val2] + 5px; 15 | } -------------------------------------------------------------------------------- /test/less/nested-gradient-with-svg-gradient/mixin-consumer.less: -------------------------------------------------------------------------------- 1 | @import "svg-gradient-mixin.less"; 2 | 3 | .gray-gradient { 4 | .gradient-mixin(#999); 5 | } 6 | -------------------------------------------------------------------------------- /test/less/nested-gradient-with-svg-gradient/svg-gradient-mixin.less: -------------------------------------------------------------------------------- 1 | .gradient-mixin(@color) { 2 | background: svg-gradient(to bottom, 3 | fade(@color, 0%) 0%, 4 | fade(@color, 5%) 60%, 5 | fade(@color, 10%) 70%, 6 | fade(@color, 15%) 73%, 7 | fade(@color, 20%) 75%, 8 | fade(@color, 25%) 80%, 9 | fade(@color, 30%) 85%, 10 | fade(@color, 35%) 88%, 11 | fade(@color, 40%) 90%, 12 | fade(@color, 45%) 95%, 13 | fade(@color, 50%) 100% 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /test/less/no-js-errors/no-js-errors.less: -------------------------------------------------------------------------------- 1 | .a { 2 | a: `1 + 1`; 3 | } -------------------------------------------------------------------------------- /test/less/no-js-errors/no-js-errors.txt: -------------------------------------------------------------------------------- 1 | SyntaxError: You are using JavaScript, which has been disabled. in {path}no-js-errors.less on line 2, column 6: 2 | 1 .a { 3 | 2 a: `1 + 1`; 4 | 3 } 5 | -------------------------------------------------------------------------------- /test/less/no-output.less: -------------------------------------------------------------------------------- 1 | .mixin() { 2 | } -------------------------------------------------------------------------------- /test/less/no-strict-math/mixins-guards.less: -------------------------------------------------------------------------------- 1 | // https://github.com/less/less.js/issues/2798 2 | .test-2798 when ((8+4) < 13) { 3 | regression: fixed; 4 | } 5 | .test-2798 when ((8+6) < 13) { 6 | regression: should not be visible; 7 | } 8 | .conditions-parser-1 when (8+4 < 13) { 9 | only-atomic: ok; 10 | } 11 | .conditions-parser-1 when (8+6 < 13) { 12 | only-atomic: should not be visible; 13 | } 14 | .conditions-parser-2 when (8+(5-1) < 13) { 15 | only-atomic-with-nested-parenthesis: ok; 16 | } 17 | .conditions-parser-2 when (8+(15-1) < 13) { 18 | only-atomic-with-nested-parenthesis: should not be visible; 19 | } 20 | .conditions-parser-3 when (8 < (13+1)) { 21 | only-atomic-nested-parenthesis-on-right: ok; 22 | } 23 | .conditions-parser-3 when (8 < (3+1)) { 24 | only-atomic-nested-parenthesis-on-right: should not be visible; 25 | } 26 | -------------------------------------------------------------------------------- /test/less/no-strict-math/no-sm-operations.less: -------------------------------------------------------------------------------- 1 | .named-colors-in-expressions { 2 | color-0: 0 -red; 3 | color-1: 1 - red; 4 | color-2: red * 2; 5 | color-3: 2 * red; 6 | @3: -red; 7 | &-bar@{3} {x: y} 8 | @color: red; 9 | &-bar@{color} {a: a}; 10 | background-color: blue-2; 11 | color: green-black; 12 | animation: blue-change 5s infinite; 13 | } 14 | .division { 15 | value: ((16px ./ 2) / 2) / 2; 16 | } 17 | -------------------------------------------------------------------------------- /test/less/parse-interpolation.less: -------------------------------------------------------------------------------- 1 | @inputs: input[type=text], input[type=email], input[type=password], textarea; 2 | 3 | @{inputs} { 4 | &:focus { 5 | foo: bar; 6 | } 7 | } 8 | 9 | @classes: .a, .b, .c; 10 | 11 | @{classes} { 12 | + .z { 13 | color: blue; 14 | } 15 | } 16 | 17 | .bar { 18 | .d@{classes}&:hover, baz { 19 | color: blue; 20 | } 21 | } 22 | 23 | @c: ~'.a, .b'; 24 | @d: ~'.c, .d'; 25 | @e: ~' + .e'; 26 | 27 | @{c}@{d} { 28 | @{e} { 29 | foo: bar; 30 | } 31 | } 32 | 33 | @textClasses: ~'&[class="text"], &.text'; 34 | 35 | input { 36 | @{textClasses} { 37 | background: red; 38 | } 39 | } 40 | 41 | @my-selector: ~'.selector-1, .selector-2'; 42 | .master-page-1 { 43 | @{my-selector} { 44 | background-color: red; 45 | } 46 | } 47 | 48 | @list: apple, satsuma, banana, pear; 49 | @{list} { 50 | .fruit-& { 51 | content: "Just a test."; 52 | } 53 | } -------------------------------------------------------------------------------- /test/less/permissive-parse.less: -------------------------------------------------------------------------------- 1 | @function-name: regexp; 2 | @d-value: 15; 3 | @-moz-document @function-name("(\d{0,@{d-value}})") { 4 | a { 5 | color: red; 6 | } 7 | } 8 | 9 | .custom-property { 10 | --this: () => { 11 | basically anything until final semi-colon; 12 | even other stuff; // i\'m serious; 13 | }; 14 | @this: () => { 15 | basically anything until final semi-colon; 16 | even other stuff; // i\'m serious; 17 | }; 18 | --that: @this; 19 | @red: lighten(red, 10%); 20 | --custom-color: @red lighten(red, 10%); 21 | custom-color: $--custom-color; 22 | } 23 | 24 | @iostat: 1; 25 | .var { 26 | --fortran: read (*, *, iostat=@iostat) radius, height; 27 | } 28 | 29 | @boom-boom: bam; 30 | @-moz-whatever (foo: "(" @boom-boom ")") { 31 | bar: foo; 32 | } 33 | 34 | @selectorList: #selector, .bar, foo[attr="blah"]; 35 | @{selectorList} { 36 | bar: value; 37 | } 38 | 39 | @size: 640px; 40 | @tablet: (min-width: @size); 41 | @media @tablet { 42 | .holy-crap { 43 | this: works; 44 | } 45 | } 46 | // @todo - fix comment absorption after property 47 | .test-comment { 48 | --value: a/* { ; } */; 49 | --comment-within: ( /* okay?; comment; */ ); 50 | } 51 | -------------------------------------------------------------------------------- /test/less/plugin-preeval.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-preeval"; 2 | 3 | .two(@rules: {}) { 4 | :root.two & { 5 | @rules(); 6 | } 7 | } 8 | 9 | .one { 10 | .two({ 11 | --foo: @replace !important; 12 | }); 13 | } 14 | 15 | @stop: end; 16 | -------------------------------------------------------------------------------- /test/less/plugin/plugin-transitive.less: -------------------------------------------------------------------------------- 1 | @plugin "plugin-transitive"; 2 | 3 | .other { 4 | trans : test-transitive(); 5 | } -------------------------------------------------------------------------------- /test/less/postProcessorPlugin/postProcessor.less: -------------------------------------------------------------------------------- 1 | @color: white; 2 | .test { 3 | color: @color; 4 | } 5 | -------------------------------------------------------------------------------- /test/less/preProcessorPlugin/preProcessor.less: -------------------------------------------------------------------------------- 1 | .test { 2 | color: @color; 3 | } 4 | -------------------------------------------------------------------------------- /test/less/rewrite-urls-all/folder/file.less: -------------------------------------------------------------------------------- 1 | #imported-file { 2 | background-image: url("./relative/path"); 3 | background-image: url("../relative/path"); 4 | background-image: url("../../relative/path"); 5 | background-image: url("module"); 6 | background-image: url("module/path"); 7 | background-image: url("module/path/../relative/path"); 8 | } 9 | -------------------------------------------------------------------------------- /test/less/rewrite-urls-all/rewrite-urls-all.less: -------------------------------------------------------------------------------- 1 | @import "./folder/file.less"; 2 | 3 | #rewrite-urls-all { 4 | background-image: url("./relative/path"); 5 | background-image: url("../relative/path"); 6 | background-image: url("./relative/../path"); 7 | background-image: url("./relative/../path/.."); 8 | background-image: url("module"); 9 | background-image: url("module/path"); 10 | background-image: url("module/path/../relative/path"); 11 | } 12 | -------------------------------------------------------------------------------- /test/less/rewrite-urls-local/folder/file.less: -------------------------------------------------------------------------------- 1 | #imported-file { 2 | background-image: url("./relative/path"); 3 | background-image: url("../relative/path"); 4 | background-image: url("../../relative/path"); 5 | background-image: url("module"); 6 | background-image: url("module/path"); 7 | background-image: url("module/path/../relative/path"); 8 | } 9 | -------------------------------------------------------------------------------- /test/less/rewrite-urls-local/rewrite-urls-local.less: -------------------------------------------------------------------------------- 1 | @import "./folder/file.less"; 2 | 3 | #rewrite-urls-local { 4 | background-image: url("./relative/path"); 5 | background-image: url("../relative/path"); 6 | background-image: url("./relative/../path"); 7 | background-image: url("./relative/../path/.."); 8 | background-image: url("module"); 9 | background-image: url("module/path"); 10 | background-image: url("module/path/../relative/path"); 11 | } 12 | -------------------------------------------------------------------------------- /test/less/rootpath-rewrite-urls-all/folder/file.less: -------------------------------------------------------------------------------- 1 | #imported-file { 2 | background-image: url("./relative/path"); 3 | background-image: url("../relative/path"); 4 | background-image: url("../../relative/path"); 5 | background-image: url("module"); 6 | background-image: url("module/path"); 7 | background-image: url("module/path/../relative/path"); 8 | } 9 | -------------------------------------------------------------------------------- /test/less/rootpath-rewrite-urls-all/rootpath-rewrite-urls-all.less: -------------------------------------------------------------------------------- 1 | @import "./folder/file.less"; 2 | 3 | #rootpath-rewrite-urls-all { 4 | background-image: url("./relative/path"); 5 | background-image: url("../relative/path"); 6 | background-image: url("./relative/../path"); 7 | background-image: url("./relative/../path/.."); 8 | background-image: url("module"); 9 | background-image: url("module/path"); 10 | background-image: url("module/path/../relative/path"); 11 | } 12 | -------------------------------------------------------------------------------- /test/less/rootpath-rewrite-urls-local/folder/file.less: -------------------------------------------------------------------------------- 1 | #imported-file { 2 | background-image: url("./relative/path"); 3 | background-image: url("../relative/path"); 4 | background-image: url("../../relative/path"); 5 | background-image: url("module"); 6 | background-image: url("module/path"); 7 | background-image: url("module/path/../relative/path"); 8 | } 9 | -------------------------------------------------------------------------------- /test/less/rootpath-rewrite-urls-local/rootpath-rewrite-urls-local.less: -------------------------------------------------------------------------------- 1 | @import "./folder/file.less"; 2 | 3 | #rootpath-rewrite-urls-local { 4 | background-image: url("./relative/path"); 5 | background-image: url("../relative/path"); 6 | background-image: url("./relative/../path"); 7 | background-image: url("./relative/../path/.."); 8 | background-image: url("module"); 9 | background-image: url("module/path"); 10 | background-image: url("module/path/../relative/path"); 11 | } 12 | -------------------------------------------------------------------------------- /test/less/rulesets.less: -------------------------------------------------------------------------------- 1 | #first > .one { 2 | > #second .two > #deux { 3 | width: 50%; 4 | #third { 5 | &:focus { 6 | color: black; 7 | #fifth { 8 | > #sixth { 9 | .seventh #eighth { 10 | + #ninth { 11 | color: purple; 12 | } 13 | } 14 | } 15 | } 16 | } 17 | height: 100%; 18 | } 19 | #fourth, #five, #six { 20 | color: #110000; 21 | .seven, .eight > #nine { 22 | border: 1px solid black; 23 | } 24 | #ten { 25 | color: red; 26 | } 27 | } 28 | } 29 | font-size: 2em; 30 | } 31 | -------------------------------------------------------------------------------- /test/less/sourcemaps-empty/empty.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdalbertoLacruz/less_dart/9dd9fdd70d987ac4fdac6d788833e411da2cdeba/test/less/sourcemaps-empty/empty.less -------------------------------------------------------------------------------- /test/less/sourcemaps-empty/var-defs.less: -------------------------------------------------------------------------------- 1 | @test-var: 'something'; -------------------------------------------------------------------------------- /test/less/sourcemaps/basic.json: -------------------------------------------------------------------------------- 1 | { 2 | "my-color": "red" 3 | } -------------------------------------------------------------------------------- /test/less/sourcemaps/basic.less: -------------------------------------------------------------------------------- 1 | @var: black; 2 | 3 | .a() { 4 | color: red; 5 | } 6 | 7 | .b { 8 | color: green; 9 | .a(); 10 | color: blue; 11 | background: @var; 12 | } 13 | 14 | .a, .b { 15 | background: green; 16 | .c, .d { 17 | background: gray; 18 | & + & { 19 | color: red; 20 | } 21 | } 22 | } 23 | 24 | .extend:extend(.a all) { 25 | color: pink; 26 | } 27 | @import (inline) "imported.css"; 28 | -------------------------------------------------------------------------------- /test/less/sourcemaps/imported.css: -------------------------------------------------------------------------------- 1 | /*comments*/ 2 | .unused-css { 3 | color: white; 4 | } 5 | .imported { 6 | color: black; 7 | } -------------------------------------------------------------------------------- /test/less/static-urls/urls.less: -------------------------------------------------------------------------------- 1 | @font-face { 2 | src: url("/fonts/garamond-pro.ttf"); 3 | src: local(Futura-Medium), 4 | url(fonts.svg#MyGeometricModern) format("svg"); 5 | } 6 | #shorthands { 7 | background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px; 8 | } 9 | #misc { 10 | background-image: url(images/image.jpg); 11 | } 12 | #data-uri { 13 | background: url(data:image/png;charset=utf-8;base64, 14 | kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/ 15 | k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U 16 | kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC); 17 | background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==); 18 | background-image: url(http://fonts.googleapis.com/css?family=\"Rokkitt\":\(400\),700); 19 | } 20 | 21 | #svg-data-uri { 22 | background: transparent url('data:image/svg+xml, '); 23 | } 24 | 25 | .comma-delimited { 26 | background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg); 27 | } 28 | .values { 29 | @a: 'Trebuchet'; 30 | url: url(@a); 31 | } 32 | 33 | @import "../import/import-and-relative-paths-test"; 34 | -------------------------------------------------------------------------------- /test/less/strict-units/strict-units.less: -------------------------------------------------------------------------------- 1 | .units { 2 | cancels-to-nothing: (1px / 1px); 3 | cancels: ((((10px / 5em) / 1px) * 3em) * 1px); 4 | } 5 | -------------------------------------------------------------------------------- /test/less/variables-in-at-rules.less: -------------------------------------------------------------------------------- 1 | 2 | @Eight: 8; 3 | @charset "UTF-@{Eight}"; 4 | 5 | @ns: less; 6 | @namespace @ns "http://lesscss.org"; 7 | 8 | @name: enlarger; 9 | @keyframes @name { 10 | from {font-size: 12px;} 11 | to {font-size: 15px;} 12 | } 13 | 14 | .m(reducer); 15 | .m(@name) { 16 | @-webkit-keyframes @name { 17 | from {font-size: 13px;} 18 | to {font-size: 10px;} 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/less/visitorPlugin/visitor.less: -------------------------------------------------------------------------------- 1 | .test { 2 | color: red; 3 | -some-aribitrary-property: value; 4 | } 5 | -------------------------------------------------------------------------------- /test/less/whitespace.less: -------------------------------------------------------------------------------- 1 | 2 | 3 | .whitespace 4 | { color: white; } 5 | 6 | .whitespace 7 | { 8 | color: white; 9 | } 10 | .whitespace 11 | { color: white; } 12 | 13 | .whitespace{color:white;} 14 | .whitespace { color : white ; } 15 | 16 | .white, 17 | .space, 18 | .mania 19 | { color: white; } 20 | 21 | .no-semi-column { color: white } 22 | .no-semi-column { 23 | color: white; 24 | white-space: pre 25 | } 26 | .no-semi-column {border: 2px solid white} 27 | .newlines { 28 | background: the, 29 | great, 30 | wall; 31 | border: 2px 32 | solid 33 | black; 34 | } 35 | .empty { 36 | 37 | } 38 | .sel 39 | .newline_ws .tab_ws { 40 | color: 41 | white; 42 | background-position: 45 43 | -23; 44 | } 45 | -------------------------------------------------------------------------------- /test/plugins/plugin_preeval.dart: -------------------------------------------------------------------------------- 1 | part of batch.test.less; 2 | 3 | /// 4 | class VisitorReplace extends VisitorBase { 5 | Visitor native; 6 | 7 | /// 8 | VisitorReplace() { 9 | isReplacing = true; 10 | isPreEvalVisitor = true; 11 | native = Visitor(this); 12 | } 13 | 14 | @override 15 | Ruleset run(Ruleset root) => native.visit(root); 16 | 17 | 18 | Node visitVariable(Variable node, VisitArgs visitArgs) { 19 | if (node.name == '@replace') { 20 | return Quoted("'", 'bar', escaped: true); 21 | } 22 | return node; 23 | } 24 | 25 | 26 | @override 27 | Function visitFtn(Node node) { 28 | if (node is Variable) return visitVariable; 29 | return null; 30 | } 31 | 32 | @override 33 | Function visitFtnOut(Node node) => null; 34 | } 35 | 36 | /// 37 | class PluginPreeval extends Plugin { 38 | @override List minVersion = [2, 1, 0]; 39 | 40 | PluginPreeval() : super(); 41 | 42 | @override 43 | void install(PluginManager pluginManager) { 44 | final VisitorBase visitor = VisitorReplace(); 45 | pluginManager.addVisitor(visitor); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /test/plugins/plugin_set_options.dart: -------------------------------------------------------------------------------- 1 | part of batch.test.less; 2 | 3 | /// 4 | class PluginSetOptions extends Plugin { 5 | @override List minVersion = [2, 1, 0]; 6 | 7 | /// 8 | String error; 9 | 10 | /// 11 | int index = 0; 12 | 13 | /// 14 | String options; 15 | 16 | /// 17 | bool optionsWereSet = false; 18 | 19 | /// options call sequence, else throws error 20 | List optionStack = [ 21 | 'option1', 22 | null, 23 | 'option2', 24 | null, 25 | 'option3' 26 | ]; 27 | 28 | @override 29 | void install(PluginManager pluginManager) { 30 | if (!optionsWereSet) { 31 | error = 'setOptions() not called before install'; 32 | } 33 | } 34 | 35 | @override 36 | void use() { 37 | final int index = (this.index++).clamp(0, optionStack.length - 1); 38 | if (options != optionStack[index]) { 39 | error = 'setOptions() not setting option $options correctly'; 40 | } 41 | 42 | if (error != null) throw LessException(error); 43 | } 44 | 45 | @override 46 | void setOptions(String cmdOptions) { 47 | optionsWereSet = true; 48 | options = cmdOptions; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /test/plugins/postprocess.dart: -------------------------------------------------------------------------------- 1 | part of batch.test.less; 2 | 3 | /// 4 | class TestPostProcessor extends Processor { 5 | /// 6 | TestPostProcessor(PluginOptions options) : super(options); 7 | 8 | @override 9 | String process(String css, Map options) => 10 | 'hr {height:50px;}\n$css'; 11 | } 12 | 13 | /// 14 | class TestPostProcessorPlugin extends Plugin { 15 | @override List minVersion = [2, 1, 0]; 16 | 17 | /// 18 | TestPostProcessorPlugin() : super(); 19 | 20 | @override 21 | void install(PluginManager pluginManager) { 22 | final Processor processor = TestPostProcessor(null); 23 | pluginManager.addPostProcessor(processor); 24 | } 25 | 26 | @override 27 | void setOptions(String cmdOptions) {} 28 | } 29 | -------------------------------------------------------------------------------- /test/plugins/preprocess.dart: -------------------------------------------------------------------------------- 1 | part of batch.test.less; 2 | 3 | /// 4 | class TestPreProcessor extends Processor { 5 | /// 6 | TestPreProcessor(PluginOptions options) : super(options); 7 | 8 | @override 9 | String process(String src, Map options) { 10 | final injected = '@color: red;\n'; 11 | final Map ignored = options['imports'].contentsIgnoredChars; 12 | final FileInfo fileInfo = options['fileInfo']; 13 | if (ignored[fileInfo.filename] == null) ignored[fileInfo.filename] = 0; 14 | ignored[fileInfo.filename] += injected.length; 15 | 16 | return '$injected$src'; 17 | } 18 | } 19 | 20 | /// 21 | class TestPreProcessorPlugin extends Plugin { 22 | @override List minVersion = [2, 1, 0]; 23 | 24 | /// 25 | TestPreProcessorPlugin() : super(); 26 | 27 | @override 28 | void install(PluginManager pluginManager) { 29 | final Processor processor = TestPreProcessor(null); 30 | pluginManager.addPreProcessor(processor); 31 | } 32 | 33 | @override 34 | void setOptions(String cmdOptions) {} 35 | } 36 | -------------------------------------------------------------------------------- /test/plugins/visitor.dart: -------------------------------------------------------------------------------- 1 | part of batch.test.less; 2 | 3 | /// 4 | class RemoveProperty extends VisitorBase { 5 | Visitor _visitor; 6 | 7 | /// 8 | RemoveProperty() { 9 | isReplacing = true; 10 | _visitor = Visitor(this); 11 | } 12 | 13 | @override 14 | Ruleset run(Ruleset root) => _visitor.visit(root); 15 | 16 | ///returns Node | List 17 | dynamic visitDeclaration(Declaration declNode, VisitArgs visitArgs) { 18 | if (declNode.name != '-some-aribitrary-property') { 19 | return declNode; 20 | } else { 21 | return []; 22 | } 23 | } 24 | 25 | @override 26 | Function visitFtn(Node node) { 27 | if (node is Declaration) return visitDeclaration; 28 | return null; 29 | } 30 | 31 | @override 32 | Function visitFtnOut(Node node) => null; 33 | } 34 | 35 | /// 36 | class TestVisitorPlugin extends Plugin { 37 | @override List minVersion = [2, 1, 0]; 38 | 39 | /// 40 | TestVisitorPlugin() : super(); 41 | 42 | @override 43 | void install(PluginManager pluginManager) { 44 | final VisitorBase visitor = RemoveProperty(); 45 | pluginManager.addVisitor(visitor); 46 | } 47 | 48 | @override 49 | void setOptions(String cmdOptions) {} 50 | } 51 | -------------------------------------------------------------------------------- /test/simply_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:less_dart/less.dart'; 3 | 4 | void main() { 5 | final less = Less(); 6 | less.transform([ 7 | '-no-color', 8 | '--strict-units=on', 9 | 'test/less/colors.less' 10 | ]).then((int lessExitCode) { 11 | stderr 12 | ..write(less.stderr.toString()) 13 | ..writeln('\nstdout:') 14 | ..write(less.stdout.toString()); 15 | exitCode = lessExitCode; 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /test/to_tree_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:less_dart/less.dart'; 3 | 4 | // Test toTree, to show a less tree 5 | // use: pub run test/to_tree_test.dart output.txt 6 | void main(List args) { 7 | final less = Less(); 8 | less.transform([ 9 | '-no-color', 10 | '--math=always', 11 | '--strict-units=on', 12 | '--show-tree-level=0', 13 | 'test/less/tree.less' 14 | ]).then((int lessExitCode) { 15 | if (args.isEmpty) { 16 | stderr 17 | ..write(less.stderr.toString()) 18 | ..writeln('\nstdout:') 19 | ..write(less.stdout.toString()); 20 | } else { 21 | stderr.write(less.stderr.toString()); 22 | File(args[0]) 23 | ..createSync(recursive: true) 24 | ..writeAsStringSync(less.stdout.toString()); 25 | } 26 | exitCode = lessExitCode; 27 | }); 28 | } 29 | -------------------------------------------------------------------------------- /test/webSourceMap/banner.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Test sourcemaps 3 | */ -------------------------------------------------------------------------------- /test/webSourceMap/custom-props-expected.css: -------------------------------------------------------------------------------- 1 | body { 2 | border-left: 1px solid var(--foo); 3 | width: calc(50% - 5px); 4 | border-top: 1px solid var(--foo); 5 | } 6 | /*# sourceMappingURL=custom-props.css.map */ -------------------------------------------------------------------------------- /test/webSourceMap/custom-props.css: -------------------------------------------------------------------------------- 1 | body { 2 | border-left: 1px solid var(--foo); 3 | width: calc(50% - 5px); 4 | border-top: 1px solid var(--foo); 5 | } 6 | /*# sourceMappingURL=custom-props.css.map */ -------------------------------------------------------------------------------- /test/webSourceMap/custom-props.css-expected.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sourceRoot":"","sources":["custom-props.less"],"names":[],"mappings":"AAEA;EACC,uBAHO,UAGP;EACA,OAAO,eAAP;EACA,sBALO,UAKP","file":"custom-props.css"} -------------------------------------------------------------------------------- /test/webSourceMap/custom-props.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sourceRoot":"","sources":["custom-props.less"],"names":[],"mappings":"AAEA;EACC,uBAHO,UAGP;EACA,OAAO,eAAP;EACA,sBALO,UAKP","file":"custom-props.css"} -------------------------------------------------------------------------------- /test/webSourceMap/custom-props.less: -------------------------------------------------------------------------------- 1 | @color: var(--foo); 2 | 3 | body { 4 | border-left: 1px solid @color; 5 | width: calc(50% - 5px); 6 | border-top: 1px solid @color; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /test/webSourceMap/import-inline.less: -------------------------------------------------------------------------------- 1 | #hGrey { 2 | text-align: center; 3 | position: absolute; 4 | background-color: #c0c0c0; 5 | color: white; 6 | } 7 | -------------------------------------------------------------------------------- /test/webSourceMap/import.less: -------------------------------------------------------------------------------- 1 | @grey: #808080; 2 | 3 | #divGrey { 4 | height: 100px; 5 | background-color: @grey; 6 | .mixina(dotted, 2px); 7 | } -------------------------------------------------------------------------------- /test/webSourceMap/index-expected.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Test sourcemaps 3 | */ 4 | #divRed { 5 | height: 100px; 6 | background-color: #ff0000; 7 | border: 2px dotted black; 8 | } 9 | #divGrey { 10 | height: 100px; 11 | background-color: #808080; 12 | border: 2px dotted black; 13 | } 14 | #hBlue { 15 | text-align: center; 16 | position: absolute; 17 | background-color: #00ff00; 18 | color: #0000ff; 19 | height: 30px; 20 | get-unit: px; 21 | get-unit-empty: ; 22 | } 23 | #hGrey { 24 | text-align: center; 25 | position: absolute; 26 | background-color: #c0c0c0; 27 | color: white; 28 | } 29 | 30 | /*# sourceMappingURL=index.map */ -------------------------------------------------------------------------------- /test/webSourceMap/index-expected.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sourceRoot":"","sources":["index.less","import.less","import-inline.less"],"names":[],"mappings":";;;AAQA;EACE;EACA;EALE;;ACHJ;EACE;EACA;EDCE;;AAWJ;EACE;EACA;EACA;EACA;EACA;EACA,UAAU,EAAV;EACA;;AEvBF;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.css"} -------------------------------------------------------------------------------- /test/webSourceMap/index-less-inline-expected.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Test sourcemaps 3 | */ 4 | #divRed { 5 | height: 100px; 6 | background-color: #ff0000; 7 | border: 2px dotted black; 8 | } 9 | #divGrey { 10 | height: 100px; 11 | background-color: #808080; 12 | border: 2px dotted black; 13 | } 14 | #hBlue { 15 | text-align: center; 16 | position: absolute; 17 | background-color: #00ff00; 18 | color: #0000ff; 19 | } 20 | #hGrey { 21 | text-align: center; 22 | position: absolute; 23 | background-color: #c0c0c0; 24 | color: white; 25 | } 26 | 27 | /*# sourceMappingURL=index-less-inline.map */ -------------------------------------------------------------------------------- /test/webSourceMap/index-less-inline-expected.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sourceRoot":"","sources":["index-less-inline.less","import.less","import-inline.less"],"names":[],"mappings":";;;AAQA;EACE;EACA;EALE;;ACHJ;EACE;EACA;EDCE;;AAWJ;EACE;EACA;EACA;EACA;;AEpBF;AACA;AACA;AACA;AACA;AACA;AACA","file":"index-less-inline.css","sourcesContent":["@red: #ff0000 ;\n@blue: #0000ff ;\n@green: #00ff00 ;\n\n.mixina (@style, @width, @color: black) {\n border: @width @style @color;\n}\n\n#divRed {\n height: 100px;\n background-color: @red;\n .mixina(dotted, 2px);\n}\n\n@import 'import.less';\n\n#hBlue {\n text-align: center;\n position: absolute;\n background-color: @green;\n color: @blue;\n}\n\n@import (inline) 'import-inline.less';","@grey: #808080;\n\n#divGrey {\n height: 100px;\n background-color: @grey;\n .mixina(dotted, 2px);\n}","#hGrey {\n text-align: center;\n position: absolute;\n background-color: #c0c0c0;\n color: white;\n}\n"]} -------------------------------------------------------------------------------- /test/webSourceMap/index-less-inline.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Test sourcemaps 3 | */ 4 | #divRed { 5 | height: 100px; 6 | background-color: #ff0000; 7 | border: 2px dotted black; 8 | } 9 | #divGrey { 10 | height: 100px; 11 | background-color: #808080; 12 | border: 2px dotted black; 13 | } 14 | #hBlue { 15 | text-align: center; 16 | position: absolute; 17 | background-color: #00ff00; 18 | color: #0000ff; 19 | } 20 | #hGrey { 21 | text-align: center; 22 | position: absolute; 23 | background-color: #c0c0c0; 24 | color: white; 25 | } 26 | 27 | /*# sourceMappingURL=index-less-inline.map */ -------------------------------------------------------------------------------- /test/webSourceMap/index-less-inline.less: -------------------------------------------------------------------------------- 1 | @red: #ff0000 ; 2 | @blue: #0000ff ; 3 | @green: #00ff00 ; 4 | 5 | .mixina (@style, @width, @color: black) { 6 | border: @width @style @color; 7 | } 8 | 9 | #divRed { 10 | height: 100px; 11 | background-color: @red; 12 | .mixina(dotted, 2px); 13 | } 14 | 15 | @import 'import.less'; 16 | 17 | #hBlue { 18 | text-align: center; 19 | position: absolute; 20 | background-color: @green; 21 | color: @blue; 22 | } 23 | 24 | @import (inline) 'import-inline.less'; -------------------------------------------------------------------------------- /test/webSourceMap/index-less-inline.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sourceRoot":"","sources":["index-less-inline.less","import.less","import-inline.less"],"names":[],"mappings":";;;AAQA;EACE;EACA;EALE;;ACHJ;EACE;EACA;EDCE;;AAWJ;EACE;EACA;EACA;EACA;;AEpBF;AACA;AACA;AACA;AACA;AACA;AACA","file":"index-less-inline.css","sourcesContent":["@red: #ff0000 ;\n@blue: #0000ff ;\n@green: #00ff00 ;\n\n.mixina (@style, @width, @color: black) {\n border: @width @style @color;\n}\n\n#divRed {\n height: 100px;\n background-color: @red;\n .mixina(dotted, 2px);\n}\n\n@import 'import.less';\n\n#hBlue {\n text-align: center;\n position: absolute;\n background-color: @green;\n color: @blue;\n}\n\n@import (inline) 'import-inline.less';","@grey: #808080;\n\n#divGrey {\n height: 100px;\n background-color: @grey;\n .mixina(dotted, 2px);\n}","#hGrey {\n text-align: center;\n position: absolute;\n background-color: #c0c0c0;\n color: white;\n}\n"]} -------------------------------------------------------------------------------- /test/webSourceMap/index-map-inline-expected.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Test sourcemaps 3 | */ 4 | #divRed { 5 | height: 100px; 6 | background-color: #ff0000; 7 | border: 2px dotted black; 8 | } 9 | #divGrey { 10 | height: 100px; 11 | background-color: #808080; 12 | border: 2px dotted black; 13 | } 14 | #hBlue { 15 | text-align: center; 16 | position: absolute; 17 | background-color: #00ff00; 18 | color: #0000ff; 19 | } 20 | #hGrey { 21 | text-align: center; 22 | position: absolute; 23 | background-color: #c0c0c0; 24 | color: white; 25 | } 26 | 27 | /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC1tYXAtaW5saW5lLmxlc3MiLCJpbXBvcnQubGVzcyIsImltcG9ydC1pbmxpbmUubGVzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFRQTtFQUNFO0VBQ0E7RUFMRTs7QUNISjtFQUNFO0VBQ0E7RURDRTs7QUFXSjtFQUNFO0VBQ0E7RUFDQTtFQUNBOztBRXBCRjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsImZpbGUiOiJpbmRleC1tYXAtaW5saW5lLmNzcyJ9 */ -------------------------------------------------------------------------------- /test/webSourceMap/index-map-inline.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Test sourcemaps 3 | */ 4 | #divRed { 5 | height: 100px; 6 | background-color: #ff0000; 7 | border: 2px dotted black; 8 | } 9 | #divGrey { 10 | height: 100px; 11 | background-color: #808080; 12 | border: 2px dotted black; 13 | } 14 | #hBlue { 15 | text-align: center; 16 | position: absolute; 17 | background-color: #00ff00; 18 | color: #0000ff; 19 | } 20 | #hGrey { 21 | text-align: center; 22 | position: absolute; 23 | background-color: #c0c0c0; 24 | color: white; 25 | } 26 | 27 | /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC1tYXAtaW5saW5lLmxlc3MiLCJpbXBvcnQubGVzcyIsImltcG9ydC1pbmxpbmUubGVzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFRQTtFQUNFO0VBQ0E7RUFMRTs7QUNISjtFQUNFO0VBQ0E7RURDRTs7QUFXSjtFQUNFO0VBQ0E7RUFDQTtFQUNBOztBRXBCRjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsImZpbGUiOiJpbmRleC1tYXAtaW5saW5lLmNzcyJ9 */ -------------------------------------------------------------------------------- /test/webSourceMap/index-map-inline.less: -------------------------------------------------------------------------------- 1 | @red: #ff0000 ; 2 | @blue: #0000ff ; 3 | @green: #00ff00 ; 4 | 5 | .mixina (@style, @width, @color: black) { 6 | border: @width @style @color; 7 | } 8 | 9 | #divRed { 10 | height: 100px; 11 | background-color: @red; 12 | .mixina(dotted, 2px); 13 | } 14 | 15 | @import 'import.less'; 16 | 17 | #hBlue { 18 | text-align: center; 19 | position: absolute; 20 | background-color: @green; 21 | color: @blue; 22 | } 23 | 24 | @import (inline) 'import-inline.less'; -------------------------------------------------------------------------------- /test/webSourceMap/index.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Test sourcemaps 3 | */ 4 | #divRed { 5 | height: 100px; 6 | background-color: #ff0000; 7 | border: 2px dotted black; 8 | } 9 | #divGrey { 10 | height: 100px; 11 | background-color: #808080; 12 | border: 2px dotted black; 13 | } 14 | #hBlue { 15 | text-align: center; 16 | position: absolute; 17 | background-color: #00ff00; 18 | color: #0000ff; 19 | height: 30px; 20 | get-unit: px; 21 | get-unit-empty: ; 22 | } 23 | #hGrey { 24 | text-align: center; 25 | position: absolute; 26 | background-color: #c0c0c0; 27 | color: white; 28 | } 29 | 30 | /*# sourceMappingURL=index.map */ -------------------------------------------------------------------------------- /test/webSourceMap/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | SourceMaps Test 7 | 8 | 9 | 10 |
11 |

SourceMaps Test

12 |
13 |
14 |

Second div

15 |
16 | 17 | -------------------------------------------------------------------------------- /test/webSourceMap/index.less: -------------------------------------------------------------------------------- 1 | @red: #ff0000 ; 2 | @blue: #0000ff ; 3 | @green: #00ff00 ; 4 | 5 | .mixina (@style, @width, @color: black) { 6 | border: @width @style @color; 7 | } 8 | 9 | #divRed { 10 | height: 100px; 11 | background-color: @red; 12 | .mixina(dotted, 2px); 13 | } 14 | 15 | @import 'import.less'; 16 | 17 | #hBlue { 18 | text-align: center; 19 | position: absolute; 20 | background-color: @green; 21 | color: @blue; 22 | height: 30px; 23 | get-unit: get-unit(10px); 24 | get-unit-empty: get-unit(10); 25 | } 26 | 27 | @import (inline) 'import-inline.less'; 28 | -------------------------------------------------------------------------------- /test/webSourceMap/index.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sourceRoot":"","sources":["index.less","import.less","import-inline.less"],"names":[],"mappings":";;;AAQA;EACE;EACA;EALE;;ACHJ;EACE;EACA;EDCE;;AAWJ;EACE;EACA;EACA;EACA;EACA;EACA,UAAU,EAAV;EACA;;AEvBF;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.css"} --------------------------------------------------------------------------------