You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The short version is that when using the Chrome app on iOS, Chrome appears to override (or otherwise bork) code for assigning body tag classes via action/board/etc.
Safari on iOS is no problem. Body classes work as expected, and you can style elements by using the body class as a parent. Switch to Chrome: they stop working.
For the example in question the array for body classes was done using Sinan's old code (shown below) rather than the humungous ternary that 2.1 uses, but it does much the same thing.
// Allow setting body tag class by action or board.
$body_class = array();
if (!empty($context['current_action']))
$body_class[] = 'action_'. $context['current_action'];
elseif (!empty($context['current_board']))
$body_class[] = 'board_'. $context['current_board'];
if (!empty($context['current_topic']))
$body_class[] = 'action_display';
if (!empty($context['max_menu_id']))
$body_class[] = 'area_' . $context['menu_data_' . $context['max_menu_id']]['current_area'];
if (!empty($context['current_subaction']))
$body_class[] = 'subaction_' . $context['current_subaction'];
if (empty($body_class))
$body_class[] = 'action_index';
With the body tag itself simply being:
<body class="', implode(' ',$body_class), '">';
This CSS works with the above template code and with Safari on iOS, but doesn't work with Chrome on iOS.
Switch the code to assign the extra classes directly to the header, rather than to the body tag, and suddenly the extra classes work with Chrome on iOS (and still work with everything else).
(Note: Obviously, when putting the extra classes directly on the header in the markup, the CSS is changed to chain classes rather than use descendants. So .header.board_1 rather than .board_1 .header, but no other changes.)
The text was updated successfully, but these errors were encountered:
Seems to work with iOS/Chrome if you put the classes on the html tag instead of the body tag. Fine with all other browsers too, as far as I know. Classing the html tag is actually a bit more versatile anyway, for no extra code, so not such a bad thing.
Can't reproduce anymore.
Tested on Chrome using an iPhone.
On this example I turned the background red using the body class for the board 1.
As you can see, using Chrome it displays the red background correctly.
Note: I have not tested this myself, due to not owning any iThingz. However, the person who tested it is not an idiot, so I think it's worth checking.
https://www.simplemachines.org/community/index.php?topic=573906.msg4061917#msg4061917
The short version is that when using the Chrome app on iOS, Chrome appears to override (or otherwise bork) code for assigning body tag classes via action/board/etc.
Safari on iOS is no problem. Body classes work as expected, and you can style elements by using the body class as a parent. Switch to Chrome: they stop working.
For the example in question the array for body classes was done using Sinan's old code (shown below) rather than the humungous ternary that 2.1 uses, but it does much the same thing.
With the body tag itself simply being:
This CSS works with the above template code and with Safari on iOS, but doesn't work with Chrome on iOS.
Switch the code to assign the extra classes directly to the header, rather than to the body tag, and suddenly the extra classes work with Chrome on iOS (and still work with everything else).
(Note: Obviously, when putting the extra classes directly on the header in the markup, the CSS is changed to chain classes rather than use descendants. So .header.board_1 rather than .board_1 .header, but no other changes.)
The text was updated successfully, but these errors were encountered: