-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Grid not working in angular7 #1210
Comments
It sounds like you have done everything right. The only thing a bit off in what you said is how you wrote the control comment. /* autoprefixer grid: autoplace */ If you have included IE in your browsers list, and added that control comment, and you are using the latest version of Autoprefixer then it should be working for you. |
What is Autoprefixer version? You can check it by |
[email protected] extraneous |
Are you have only one Autoprefixer in that list? |
Yea only one on the list but getting this error npm ERR! extraneous: [email protected] C:\Projects\ClientCommandCentre\node_modules\autoprefixer |
What is paths for Browserslist config and CSS file? |
C:\Projects\ClientCommandCentre\src\browserslist |
Can you create a simple a {
display: grid
} Maybe the problem is in mixin? |
Try this: /* autoprefixer grid: autoplace */
.test {
display: grid;
grid-template-rows: auto;
grid-template-columns: auto;
} |
If that doesn't work, maybe your compiler is stripping out comments before Autoprefixer has a chance to run. |
So after the scss has been compiled the comments should still be in the css? Looks like the compiled style sheet doesnt have any of the comments. |
Yes. That is your problem. Don't do this: // autoprefixer grid: autoplace
.test {
display: grid;
grid-template-rows: auto;
grid-template-columns: auto;
} Do this: /* autoprefixer grid: autoplace */
.test {
display: grid;
grid-template-rows: auto;
grid-template-columns: auto;
} There is a difference. |
Yep thats what I'm doing, just when I'm building the application its optimizing the css so stripping out all the comments. Will give that ago and see if it works! |
You can also try this: /*! autoprefixer grid: autoplace */
.test {
display: grid;
grid-template-rows: auto;
grid-template-columns: auto;
} |
I've got it working, was some dependency issues ran npm audit fix and sorted the issue. |
Can you close the issue then? |
Thanks for your help |
I also try to activate the autoprefixer for the grid-layout (also for flexboxes) on I have an
In top of my
The css grid settings
Does the angular.json need to have anything added to it? What im doing wrong? Related issues: |
|
@ai The Angular cli generates a separate <style> tag for each component! Does anyone know how to apply an autoprefixer ( |
@SerkanSipahi you need access to PostCSS config to set option globally. As I know Angular doesn't provide this API. |
That's really very painful. Even for flexboxes you have to set the autoprefixer directive @ai |
Both |
I ran into the same issue, solely because the angular docs tell us to put it at the top of the global styles file. It didn't work for me in my project, but when I tried to reproduce it in a new project, it worked fine. Not sure what causes it to stop working. Like the others, putting the autoprefixer comment at the top of an individual component's style sheet works fine. |
That's weird, the documentation says to use:
or
It is meant to be this:
Unless if the Angular examples are Angular's way of telling it not to remove the comments when compiling. |
Autoprefixer doesn't check your scss code, he's checking the already compiled css code. So you have to mention where to add your autoprefixer comments. And as far as i know, the autoprefixer comments are just used for the whole next css block. |
I am trying to get Angular7 working nicely with the Autoprefixer. I'm specifically looking to get support on IE11. I've removed the "not" from "IE 9 - 11" in the browserlist file. I've also added
/* autoprefixer grid: autoplace / / autoprefixer grid: on */
To the top of my _grid.scss file. Problem is grid items are still not getting any prefixes. Flexbox seems to work fine but not CSS grid. Is there any configuration I've missed?
The text was updated successfully, but these errors were encountered: