Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Chrome console recommends dppx instead of dpi even if dppx is used

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #167230
    rpk
    Participant

    I have a subtle pattern as background image. One image for regular resolutions and one double the size for retina displays. i wanted to display the retina background image starting with a resolution of 1.5 . But no matter what i try either with 1.5 dppx or without:

    body {
        background: image-url('ttg.png') repeat top left;
        @media  (min-resolution: 1.5dppx), (-webkit-min-device-pixel-ratio: 1.5), (-moz-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
            background: image-url('[email protected]') repeat top left;
            background-size: 476px 476px;
        }
    }
    

    Chrome is throwing a recommendation at me in the console:

    Consider using ‘dppx’ units instead of ‘dpi’, as in CSS ‘dpi’ means dots-per-CSS-inch, not dots-per-physical-inch, so does not correspond to the actual ‘dpi’ of a screen. In media query expression: (-webkit-min-device-pixel-ratio: 1.5), not all, (min-resolution: 144dpi)

    No matter if i leave (min-resolution: 1.5dppx), in or cut it out. What is the reason for that behaviour? Safari isn’t showing anything similar. :/ Best regards Ralf

    #167236
    Paulie_D
    Member

    Safari isn’t showing anything similar.

    Because Chrome is better!

    #167237
    rpk
    Participant

    hmmm and what would be the appropriate retina media query to satisfy Chrome? I get that remark no matter if i use (min-resolution: 1.5dppx) or not.

    #167240
    Alan C
    Participant

    Well there is an article Here that gives the retina display media queries, maybe try one of those?

    #167242
    rpk
    Participant

    well i already used more or less the same like in the article by leaving out the dppx min-resolution, only leaving the moz prefix in. but i left that out too now, just:

    @media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi)
    

    but Chromes answer is still the same:

    Consider using ‘dppx’ units instead of ‘dpi’, as in CSS ‘dpi’ means dots-per-CSS-inch, not dots-per-physical-inch, so does not correspond to the actual ‘dpi’ of a screen. In media query expression: (-webkit-min-device-pixel-ratio: 1.5), not all, (min-resolution: 144dpi)

    #187595
    Cyclodex
    Participant

    Just for a follow up, this was a bug…

    If you have dppx override, it should not show you this message anymore.
    For testing: http://jsfiddle.net/gMRv9/

    #188307
    rpk
    Participant

    Cool thanks a lot for the info!

    #195384
    oviliz
    Participant

    So it is still a bug even the latest Chrome update?

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘CSS’ is closed to new topics and replies.