Skip to content

Commit e691084

Browse files
committed
improve rendering of ctrl + K
1 parent 68c23f3 commit e691084

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

apify-docs-theme/src/theme/SearchBar/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import BrowserOnly from '@docusaurus/BrowserOnly';
33
import RouterLink from '@docusaurus/Link';
44
// import { useHistory, useLocation } from '@docusaurus/router';
55
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
6+
import clsx from 'clsx';
67
// import React, { useCallback } from 'react';
78
import React, { useEffect, useState } from 'react';
89

@@ -212,7 +213,7 @@ export default function SearchBar({ onClick }) {
212213
</span>
213214
<span className="DocSearch-Button-Keys">
214215
{key !== null && (<>
215-
<kbd className="DocSearch-Button-Key">
216+
<kbd className={clsx(key === 'ctrl' ? 'ctrl' : 'cmd', 'DocSearch-Button-Key')}>
216217
{key === 'ctrl' ? <ControlKeyIcon/> : key}
217218
</kbd>
218219
<kbd className="DocSearch-Button-Key">K</kbd>

apify-docs-theme/src/theme/custom.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,3 +1992,8 @@ div[class^="navbarSearchContainer"] {
19921992
.DocSearch-Button-Key {
19931993
border: 0;
19941994
}
1995+
1996+
.DocSearch-Button-Key.ctrl:first-child {
1997+
width: 14px !important;
1998+
height: 15px !important;
1999+
}

0 commit comments

Comments
 (0)