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

Add className option for toolbar items #1951

Merged
merged 3 commits into from
Jun 25, 2019
Merged

Add className option for toolbar items #1951

merged 3 commits into from
Jun 25, 2019

Conversation

mkaz
Copy link
Contributor

@mkaz mkaz commented Jun 25, 2019

Allows for passing in a className when registering a toolbar button to allow to target via CSS.

An example:

   Prism.plugins.toolbar.registerButton( 'my-button', {
        text: 'My Button',
        className: 'my-button',
    });

This will add the span element <span class="my-button">My Button</span>

Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkaz Thank you for this PR!

Please also adjust the type definition of opts and the formatting (no leading/trailing spaces inside round braces).

@mkaz
Copy link
Contributor Author

mkaz commented Jun 25, 2019

@RunDevelopment Updated my PR per review, thanks!

@mAAdhaTTah
Copy link
Member

One minor nit but lgtm!

Co-Authored-By: James DiGioia <jamesorodig@gmail.com>
@mAAdhaTTah mAAdhaTTah merged commit 5ab28bb into PrismJS:master Jun 25, 2019
@mAAdhaTTah
Copy link
Member

Thank you for the contribution!

@mkaz mkaz deleted the extend-toolbar branch June 25, 2019 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants