The Calculation Process
In order to choose a model from the ruleset, Thinfinity uses the client device type, dimensions, resolution, orientation and browser:
1. If match-mobile exists, it tests if device is a mobile.
2. If match-user-agent exists, it tests the browser’s User Agent.
3. If match-device-pixel-ratio exists, it tests the device’s pixel ratio.
4. If match-orientation exists, it tests the device’s orientation.
5. If match-screen-width-range or match-screen-height-range exist, it tests to see if the screen size is in range.
6. If match-screen-width or match-screen-height exist, it tests the exact screen size.
Once the model is selected, the parameters are applied in this way:
1. If the width and height properties exist, then it applies them.
2. If the browser width is less than the min-width, it applies min-width.
3. If the browser height is less than the min-height, it applies min-height.
4. If the browser width is greater than the max-width, it applies max-width.
5. If the browser height is greater than the max-height, it applies max-height.
6. If a specific device-pixel-ratio was specified, it applies it.
7. If a max-device-ratio was specified, it takes the minimum of the real device pixel ratio and max-device-ratio property and applies it.