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

[css-grid] place-self can be translated #1143

Closed
Dan503 opened this issue Oct 17, 2018 · 7 comments · Fixed by #1144
Closed

[css-grid] place-self can be translated #1143

Dan503 opened this issue Oct 17, 2018 · 7 comments · Fixed by #1144
Labels

Comments

@Dan503
Copy link
Contributor

Dan503 commented Oct 17, 2018

I'm kicking myself for not realizing this while we were working on the align/justify-content/items warnings >_<

Input CSS

.grid > * {
  place-self: center;
}

Current Output CSS

.grid > * {
  place-self: center;
}

Expected output CSS

.grid > * {
  -ms-grid-row-align: center;
  -ms-grid-column-align: center;
  place-self: center;
}
@Dan503
Copy link
Contributor Author

Dan503 commented Oct 17, 2018

Also be aware of the 2 value syntax

Input CSS

.grid > * {
  place-self: start end;
}

Current Output CSS

.grid > * {
  place-self: start end;
}

Expected output CSS

.grid > * {
  -ms-grid-row-align: start;
  -ms-grid-column-align: end;
  place-self: start end;
}

@Dan503
Copy link
Contributor Author

Dan503 commented Oct 17, 2018

Also be aware that if you write this CSS:

.grid {
  display: grid;
  place-items: start end;
}

It will output this warning:

autoprefixer: C:\xxx\autoprefixer\playground\output.css:11:3: IE does not support place-items on grid containers. Try using place-self on child elements instead: .grid > * { place-self: start end }

This warning is misleading to users as using place-self currently does not get translated by Autoprefixer.

@Dan503 Dan503 changed the title place-self can be translated [css-grid] place-self can be translated Oct 17, 2018
@ai
Copy link
Member

ai commented Oct 17, 2018

@bogdan0083 do you want to implement it?

@Dan503
Copy link
Contributor Author

Dan503 commented Oct 18, 2018

I tried seeing if I could fix it myself since I need this fixed for the article...

I couldn't figure it out though :(

@bogdan0083 I need your help getting this one fixed so that I can mention this translation in my new article.

@bogdan0083
Copy link
Contributor

bogdan0083 commented Oct 18, 2018

Sure! I will try to fix this issue 🙂

@bogdan0083
Copy link
Contributor

bogdan0083 commented Oct 18, 2018

@ai How can I not prefix the property if grid feature is disabled? I added place-self to the prefixes.js:

// CSS Grid Layout
let grid = require('caniuse-lite/data/features/css-grid')

f(grid, browsers => {
  prefix(['display-grid', 'inline-grid'], {
    props: ['display'],
    feature: 'css-grid',
    browsers
  })
  prefix([
    'grid-template-columns', 'grid-template-rows',
    'grid-row-start', 'grid-column-start',
    'grid-row-end', 'grid-column-end',
    'grid-row', 'grid-column', 'grid-area',
    'grid-template', 'grid-template-areas', 'place-self' // here
  ], {
    feature: 'css-grid',
    browsers
  })
})

The hack works, but the test case with grid disabled (grid.disabled.css) fails, because it still adds place-self prefixes.

Upd 1: I also didn't find place-self property on Can I Use 🤔

Upd 2: Do I need to send PR to caniuse to add place-(self/items) properties? I'm not sure, because we need place-self only for css grid prefixes.

@ai
Copy link
Member

ai commented Oct 23, 2018

Released in 9.3

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

Successfully merging a pull request may close this issue.

3 participants