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

added superscript and subscript buttons in playground #1945

Merged
merged 14 commits into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated svg for more text options, fixed style issues
  • Loading branch information
animeshk874 committed Apr 28, 2022
commit 12745f33eeeb07ed034f31b80190a4773121f1ea
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions packages/lexical-playground/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1545,3 +1545,11 @@ button.action-button:disabled {
.spacer {
letter-spacing: -2px;
}

button.item.dropdown-item-active {
background-color: rgba(223, 232, 250, 0.3);
}

button.item.dropdown-item-active i {
opacity: 1;
}
12 changes: 9 additions & 3 deletions packages/lexical-playground/src/plugins/ToolbarPlugin.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,9 @@ export default function ToolbarPlugin(): React$Node {
'strikethrough',
);
}}
className={'item ' + (isStrikethrough ? 'active' : '')}
className={
'item ' + (isStrikethrough ? 'active dropdown-item-active' : '')
}
title="Strikethrough"
aria-label="Format text with a strikethrough">
<i className="icon strikethrough" />
Expand All @@ -1071,7 +1073,9 @@ export default function ToolbarPlugin(): React$Node {
onClick={() => {
activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND, 'subscript');
}}
className={'item ' + (isSubscript ? 'active' : '')}
className={
'item ' + (isSubscript ? 'active dropdown-item-active' : '')
}
title="Subscript"
aria-label="Format text with a subscript">
<i className="icon subscript" />
Expand All @@ -1084,7 +1088,9 @@ export default function ToolbarPlugin(): React$Node {
'superscript',
);
}}
className={'item ' + (isSuperscript ? 'active' : '')}
className={
'item ' + (isSuperscript ? 'active dropdown-item-active' : '')
}
title="Superscript"
aria-label="Format text with a superscript">
<i className="icon superscript" />
Expand Down