question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Ionic 2 feature] Overlays (Alert, Popover): cssClass option with support for multiple classes

See original GitHub issue

For a better and more flexible styling of my alert and popover overlays I would like to have the cssClass option supporting multiple classes. That could be in the form of concatenated class names or as an array of class names.

Now the cssClass supportes only one string token, any space character within results in runtime exceptions (InvalidCharacterError).

So cssClass="class-1 class-2" or cssClass=['class-1', 'class-2'] would be ideal.

Platform: Ionic 2 beta.11

Thank you!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brandyscarneycommented, Aug 9, 2016

Thanks! I have added support for multiple classes to be passed to Popover, Action Sheet, Loading, and Toast components. It was already supported for the Alert and Picker components. I published a nightly version if you would like to test it out:

npm install --save ionic-angular@2.0.0-beta.11-201608092109
1reaction
brandyscarneycommented, Aug 9, 2016

You currently can pass multiple classes, like so:

  doAlert() {
    let alert = this.alertCtrl.create({
      title: 'Alert',
      subTitle: 'Subtitle',
      message: 'This is an alert message.',
      buttons: ['OK'],
      cssClass: 'my-alert another-class'
    });

    alert.present();
  }

This should probably be documented better though. How are you currently trying to pass it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ion-popover
ion -popover is a dialog that appears on top of the current page. Learn about the popover UI component and CSS custom properties...
Read more >
add cssClass property to modal options · Issue #10020 · ...
Current behavior: Currently, you cannot pass in a cssClass name into the modalOptions object as you can do on alerts, popovers, etc. Expected ......
Read more >
UI Bootstrap - Angular directives for Bootstrap
A lightweight, extensible directive for fancy popover creation. The popover directive supports multiple placements, optional transition animation, and more.
Read more >
Modal | Components
Modals are streamlined, but flexible dialog prompts powered by JavaScript and CSS. They support a number of use cases from user notification to...
Read more >
Snippets
backdropDismiss - if set to true, the modal will be dismissed when the backdrop is clicked;; componentProps - data to pass to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found