Description
Return the max-width in pixels taking into account the contextI started writing these comments then realised it would be just as easy to get the user to type in a single number rather than mess about with calculations. Here's some documentation explaining what would have needed to have been done… The RWD classes are intended for use within the main content which may be next to some sidebars and then further padded out by left and right margins. +——–+———————————+——–+
| left | body | right | |
|---|---|---|---|
| +———————–+———+ | |||
| main content | sidebar | ||
| breakpoint |
- breakpoint – min width in pixels before the main content breaks
- sidebar – %age to allow for sidebars
- margins – %age to allow for margins
Usage
oik_rwd_adjusted_max_width_for_context();Parameters
Returns
voidSource
File name: oik-rwd/shortcodes/oik-rwd.phpLines:
1 to 12 of 12
function oik_rwd_adjusted_max_width_for_context( ) { static $max_width; if ( is_null( $max_width ) ) { $max_width = bw_get_option( "max_width", "bw_rwd" ); if ( $max_width && is_numeric( $max_width ) ) { // Good - we'll use this - let's hope it's greater than or equal to 768. } else { $max_width = 768; } } return( $max_width ); }View on GitHub
Called by
1 to 2 of 2
- oik_rwd_default_media_rules() – We’re trying to create a set of media queries with graceful degradation as the window width narrows So we need to know min/max width at which a transition occurs and how to cater for different percentages.
- oik_rwd_test_area() – Display the test area using an iframe of the home page
Invoked by
Calls
Call hooks
API Letters:
