Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Sass Modules Suport? #18

Closed
HybridSolutions opened this issue Jul 9, 2021 · 1 comment
Closed

Sass Modules Suport? #18

HybridSolutions opened this issue Jul 9, 2021 · 1 comment
Labels

Comments

@HybridSolutions
Copy link

Does SharpScss support Sass modules?

@use 'sass:math';

@mixin shape($edges-number: 6, $main-radius: 30%, $rounding-radius: 10%, $rotated: true, $precision: 20) {
	$central-angle: divide(360deg, $edges-number);
	$angle: ($edges-number - 2) * divide(180deg, $edges-number);
	$max-var-angle: 2 * (90deg - divide($angle, 2));
	$precision: 6;
	$unit-var-angle: divide($max-var-angle, $precision);	
	$r-diff: $main-radius + $rounding-radius;

	$points: ();

	@for $i from 0 to $edges-number {
		$vertex-angle: $i * $central-angle + if($rotated, -90deg, 0deg);
		$vertex-x: 50% + $r-diff * math.cos($vertex-angle);
		$vertex-y: 50% + $r-diff * math.sin($vertex-angle);

		@for $j from 0 through $precision {
			$curr-angle: $vertex-angle + ($j - 0.5 * $precision) * $unit-var-angle;
			$x: $vertex-x + $rounding-radius * math.cos($curr-angle);
			$y: $vertex-y + $rounding-radius * math.sin($curr-angle);

			$points: $points, $x $y;
		}
	}
	
	clip-path: polygon($points);
}

This code returns an error when compiling.

SharpScss.ScssException: Error: Invalid CSS after "... $r-diff * math": expected expression (e.g. 1px, bold), was ".cos($vertex-angle)"
        on line 16:34 of wwwroot/lib/metronic/components/mixins/_shape.scss
        from line 15:1 of wwwroot/lib/metronic/components/_mixins.scss
        from line 9:1 of wwwroot/lib/metronic/_init.scss
        from line 9:1 of wwwroot/lib/metronic/style.scss
>>              $vertex-x: 50% + $r-diff * math.cos($vertex-angle);
         ---------------------------------^

Any help to fix this is much appreciated!

@xoofx xoofx added the question label Jul 9, 2021
@xoofx
Copy link
Owner

xoofx commented Jul 9, 2021

@xoofx xoofx closed this as completed Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants