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

Doesn't work as expected #1

Open
schel4ok opened this issue Feb 21, 2021 · 0 comments
Open

Doesn't work as expected #1

schel4ok opened this issue Feb 21, 2021 · 0 comments

Comments

@schel4ok
Copy link

mix.js('resources/js/app.js', 'public/js')
   .postCss('resources/css/app.css', 'public/css', [
      require('postcss-import'), 
      require('postcss-svg'),
      require('postcss-mixins'),
      require('postcss-each-variables'),
      require('postcss-extend'),
      require('postcss-nested'),
      require('tailwindcss'),     
      require('autoprefixer'),
    ]);

I have this in input css file

:root {
	--icons: (
		check:				url("../views/components/svg/listicons.svg#check"),
		check-rounded: 		url("../views/components/svg/listicons.svg#check-rounded"),
		check-squared: 		url("../views/components/svg/listicons.svg#check-squared"),
		checklist: 			url("../views/components/svg/listicons.svg#checklist"),
		chevron: 			url("../views/components/svg/listicons.svg#chevron"),
		thumb-up-outline: 	url("../views/components/svg/listicons.svg#thumb-up-outline"),
		thumb-up-solid: 	url("../views/components/svg/listicons.svg#thumb-up-solid"),
		tools: 				url("../views/components/svg/listicons.svg#tools")
	);
}


@each $key, $value in var(--icons) {
	.svg-list-$(key) {
		content: $(value);
	}
}

And I have following output

:root {
  --icons: (
		check:				url(/images/listicons.svg?2a63c466cf4a3dc372356d34ce53757d#check),
		check-rounded: 		url(/images/listicons.svg?2a63c466cf4a3dc372356d34ce53757d#check-rounded),
		check-squared: 		url(/images/listicons.svg?2a63c466cf4a3dc372356d34ce53757d#check-squared),
		checklist: 			url(/images/listicons.svg?2a63c466cf4a3dc372356d34ce53757d#checklist),
		chevron: 			url(/images/listicons.svg?2a63c466cf4a3dc372356d34ce53757d#chevron),
		thumb-up-outline: 	url(/images/listicons.svg?2a63c466cf4a3dc372356d34ce53757d#thumb-up-outline),
		thumb-up-solid: 	url(/images/listicons.svg?2a63c466cf4a3dc372356d34ce53757d#thumb-up-solid),
		tools: 				url(/images/listicons.svg?2a63c466cf4a3dc372356d34ce53757d#tools)
	);
}

@each $key, $value in (check,check-rounded,check-squared,checklist,chevron,thumb-up-outline,thumb-up-solid,tools), (url("../views/components/svg/listicons.svg#check"),url("../views/components/svg/listicons.svg#check-rounded"),url("../views/components/svg/listicons.svg#check-squared"),url("../views/components/svg/listicons.svg#checklist"),url("../views/components/svg/listicons.svg#chevron"),url("../views/components/svg/listicons.svg#thumb-up-outline"),url("../views/components/svg/listicons.svg#thumb-up-solid"),url("../views/components/svg/listicons.svg#tools")) {
  .svg-list-$(key) {
    content: $(value);
  }
}

To me it seems like @each loop didn't launched. I expected to have 8 separate styles on the output from .svg-list-check to .svg-list-tools. What is wrong with my code?

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

No branches or pull requests

1 participant