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

enhance(mfm): $[tada ] のフォントサイズは1段階しか大きくならないように #13757

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Unreleased

### Note
- MFM `$[tada ]` をネストしても、文字列は1段階しか大きくならないようになりました

### General
-

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
case 'tada': {
const speed = validTime(token.props.args.speed) ?? '1s';
const delay = validTime(token.props.args.delay) ?? '0s';
style = 'font-size: 150%;' + (useAnim ? `animation: global-tada ${speed} linear infinite both; animation-delay: ${delay};` : '');
break;
style = (useAnim ? `animation: global-tada ${speed} linear infinite both; animation-delay: ${delay};` : '');
return h('span', {
style: 'display: inline-block; ' + style,
class: 'mfm-tada',
}, genEl(token.children, scale));
}
case 'jelly': {
const speed = validTime(token.props.args.speed) ?? '1s';
Expand Down
8 changes: 8 additions & 0 deletions packages/frontend/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,14 @@ html[data-color-mode=dark] ._woodenFrame {
}
}

.mfm-tada {
font-size: 150%;
}

.mfm-tada:has(.mfm-tada) {
Copy link
Member

Choose a reason for hiding this comment

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

hasセレクタって重そうな気がしたけどどうだろう

Copy link
Contributor Author

@kakkokari-gtyih kakkokari-gtyih May 18, 2024

Choose a reason for hiding this comment

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

そもそも登場頻度(このクエリに引っかかること)は高くない気がするので大丈夫かも

Copy link
Member

Choose a reason for hiding this comment

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

ブラウザが「このクエリに引っかかるかどうか」を判定すること自体のコストが高いという話だわね

font-size: 100%;
}

.mfm-x2 {
--mfm-zoom-size: 200%;
}
Expand Down
Loading