Skip to content

Commit 8a32c4d

Browse files
committed
MOBILE-4926 style: Add display modes for phones
1 parent 023dfd7 commit 8a32c4d

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

src/core/directives/tests/behat/format_text.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,19 @@ Feature: Test functionality added by the format-text directive
2020
| label | C1 | Label title | <div data-app-alt-url="#wwwroot#/my/courses.php">Content for browser</div> |
2121
| label | C1 | Label 2 title | <div data-app-alt-url="#wwwroot#/?redirect=0" data-app-alt-msg="Open this link" data-open-in="app" data-app-url-confirm="Custom confirm.">Content for browser</div> |
2222
| label | C1 | Label 3 title | <div data-app-alt-url="#wwwroot#/user/view.php" data-open-in="app">Content for browser</div> |
23+
| label | C1 | Label 3 title | <div class="d-none mobileapp-d-block">No lms, but yes mobile app</div><div class="d-block mobileapp-d-none">Yes lms, but no mobile app</div><div class="d-none mobileapp-d-inline">Inline in mobile app</div><div class="d-none mobileapp-d-inline-block">Inline-block in mobile app</div><div class="d-none mobileapp-d-flex">Flex in mobile app</div> |
2324
Given I entered the course "Course 1" as "student1" in the app
2425
Then I should find "Open this link" in the app
2526
And I should find "$WWWROOT/my/courses.php" in the app
2627
And I should find "$WWWROOT/?redirect=0" in the app
2728
But I should not find "Content for browser" in the app
2829

30+
And I should find "No lms, but yes mobile app" in the app
31+
And I should find "Inline in mobile app" in the app
32+
And I should find "Inline-block in mobile app" in the app
33+
And I should find "Flex in mobile app" in the app
34+
But I should not find "Yes lms, but no mobile app" in the app
35+
2936
When I press "$WWWROOT/my/courses.php" in the app
3037
Then I should not find "Custom confirm" in the app
3138

src/theme/components/format-text.scss

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,3 +391,61 @@ ion-header.ios h1 core-format-text {
391391
:root.dark core-rich-text-editor .core-rte-editor select {
392392
background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
393393
}
394+
395+
396+
:root.plt-ios core-format-text,
397+
:root.plt-ios .item core-format-text {
398+
.mobileapp-ios-d-none {
399+
display: none !important;
400+
}
401+
.mobileapp-ios-d-block {
402+
display: block !important;
403+
}
404+
.mobileapp-ios-d-inline {
405+
display: inline !important;
406+
}
407+
.mobileapp-ios-d-inline-block {
408+
display: inline-block !important;
409+
}
410+
.mobileapp-ios-d-flex {
411+
display: flex !important;
412+
}
413+
}
414+
415+
:root.plt-android core-format-text,
416+
:root.plt-android .item core-format-text {
417+
.mobileapp-android-d-none {
418+
display: none !important;
419+
}
420+
.mobileapp-android-d-block {
421+
display: block !important;
422+
}
423+
.mobileapp-android-d-inline {
424+
display: inline !important;
425+
}
426+
.mobileapp-android-d-inline-block {
427+
display: inline-block !important;
428+
}
429+
.mobileapp-android-d-flex {
430+
display: flex !important;
431+
}
432+
}
433+
434+
:root core-format-text,
435+
:root .item core-format-text {
436+
.mobileapp-d-none {
437+
display: none !important;
438+
}
439+
.mobileapp-d-block {
440+
display: block !important;
441+
}
442+
.mobileapp-d-inline {
443+
display: inline !important;
444+
}
445+
.mobileapp-d-inline-block {
446+
display: inline-block !important;
447+
}
448+
.mobileapp-d-flex {
449+
display: flex !important;
450+
}
451+
}

0 commit comments

Comments
 (0)