Skip to content

Commit cdb4456

Browse files
authored
test(styles): update button styles for test pages (#29931)
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> Test styles causes native buttons to have [certain styling](https://github.com/ionic-team/ionic-framework/blob/main/core/scripts/testing/styles.css#L52-L64). This was done to spruce up the buttons used for testing purposes only. However, this ended up adding styles to native buttons within Ionic components. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Test styles for native buttons are only applied to buttons that are not part of a Ionic component ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> How to test: 1. Run the project locally from the `main` branch 2. [Comment](https://github.com/ionic-team/ionic-framework/blob/5d208e9daacad63294489e0b1bd6ec2b2645babd/core/src/components/searchbar/searchbar.md.scss#L91) out `border: 0` from `.searchbar-clear-button` from the searchbar `md` theme file (`ios` also works) 3. Navigate to the basic test page: `/src/components/searchbar/test/basic` 4. Notice a teal border around the clear buttons 5. Checkout to this PR's branch 6. Make sure steps 2-3 are done 7. Verify that the teal border is not being applied to the clear buttons 8. Verify that only native buttons outside of the Ionic components have a teal appearance: `/src/components/loading/test/standalone` and `/src/components/action-sheet/test/is-open`
1 parent bbcbf5c commit cdb4456

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

core/scripts/testing/styles.css

Lines changed: 26 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/src/components/popover/test/size/index.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
ion-app > ion-content {
1717
--background: #dddddd;
1818
}
19-
ion-content button {
19+
ion-content button.trigger {
2020
padding: 12px 16px;
2121
}
2222
.grid {
@@ -57,26 +57,30 @@
5757
<div class="grid">
5858
<div class="grid-item">
5959
<h2>Cover</h2>
60-
<button id="cover-trigger">Trigger</button>
60+
<button id="cover-trigger" class="trigger">Trigger</button>
6161
<ion-popover show-backdrop="false" class="cover-popover" trigger="cover-trigger" size="cover">
6262
<ion-content class="ion-padding"> My really really really really long content </ion-content>
6363
</ion-popover>
6464
</div>
6565
<div class="grid-item">
6666
<h2>With Event</h2>
67-
<button id="event-trigger" onclick="openPopover('event-popover', event, 'false')">Trigger</button>
67+
<button id="event-trigger" class="trigger" onclick="openPopover('event-popover', event, 'false')">
68+
Trigger
69+
</button>
6870
</div>
6971

7072
<div class="grid-item">
7173
<h2>Auto</h2>
72-
<button id="auto-trigger">Trigger</button>
74+
<button id="auto-trigger" class="trigger">Trigger</button>
7375
<ion-popover show-backdrop="false" class="auto-popover" trigger="auto-trigger">
7476
<ion-content class="ion-padding"> My really really really really long content </ion-content>
7577
</ion-popover>
7678
</div>
7779
<div class="grid-item">
7880
<h2>No Event</h2>
79-
<button id="no-event-trigger" onclick="openPopover('no-event-popover', null, 'true')">Trigger</button>
81+
<button id="no-event-trigger" class="trigger" onclick="openPopover('no-event-popover', null, 'true')">
82+
Trigger
83+
</button>
8084
</div>
8185
</div>
8286
</ion-content>

0 commit comments

Comments
 (0)