Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: consider restyling arrow #13

Open
Misiu opened this issue Sep 29, 2017 · 4 comments
Open

Feature: consider restyling arrow #13

Misiu opened this issue Sep 29, 2017 · 4 comments

Comments

@Misiu
Copy link

Misiu commented Sep 29, 2017

Currently arrow is just a flat triangle, that doesn't look good on white background:
snap 2017-09-29 at 10 28 33

I've added arrow in away that Bootstrap 4 does that (using ::before and ::after selectors):
snap 2017-09-29 at 10 29 20

Here is my prove of concept: https://stackblitz.com/edit/mde-popover-kg8eqr?file=styles.scss

I've just looked at how Google did they popup, they are using two triangles and offset them by one pixel. This way they get the border effect. Maybe this could be used instead of pseudo selectors.

@joejordanbrown
Copy link
Owner

@Misiu

Thanks for the feature request.

I had thought of doing this in the first place but I decided not to include that because the popover actually doesn't add any styling related to borders or box shadows.

When I redesign this I was thinking of removing the colour option and to just provide examples of CSS to customise the arrow. The best option would be to provide SASS with variables to change to auto generate the styles for that config. This could then be wrapped with a CSS class and easily have different styles for different popovers.

What do you think of that approach?

@Misiu
Copy link
Author

Misiu commented Oct 2, 2017

@joejordanbrown sorry for late response.
For me the approach with SASS and variables would work fine. This would remove a lot of code from typescript file. Please consider adding example how to have multiple tooltipson same page but with different look.

@leblancmeneses
Copy link

image

I tried using the styles in the attached image. They look good but the cdk is adjusting the popover even when using mdePopoverPositionY="above" . Just another edge case for this ticket.

    <h3>Gross profit per transaction?
      <button mat-icon-button color="accent" #profitInfoReasonTarget="mdePopoverTrigger"
          [mdePopoverTriggerFor]="profitInfoReason"
          [mdePopoverOverlapTrigger]="false"
          [mdePopoverOffsetX]="3">
        <mat-icon>info_outline</mat-icon>
      </button>
    </h3>
    <mat-slider [max]="profitLimits.max" [min]="profitLimits.min" [(ngModel)]="profit"
      (focus)="profitInfoReasonTarget.openPopover()"
      (blur)="profitInfoReasonTarget.closePopover()"
      (change)="onSlideChange()"
      [thumb-label]="true">
    </mat-slider>

<mde-popover #profitInfoReason="mdePopover" mdePopoverPositionY="above">
  <mat-card style="max-width: 300px">
    <mat-card-content>
      <p>test</p>
    </mat-card-content>
  </mat-card>
</mde-popover>

@hide-pms
Copy link

how set Arrow placement left right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants