-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(v2): refactor icons in theme-classic, fix swizzle issue (#3854)
* fix(v2): refactor icons in theme-classic, fix swizzle issue * apply review suggestion * fix IconMenu className
- Loading branch information
Showing
14 changed files
with
156 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/docusaurus-theme-classic/src/theme/IconArrow/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import {Props} from '@theme/IconArrow'; | ||
|
||
const IconArrow = (props: Props): JSX.Element => { | ||
return ( | ||
<svg width="20" height="20" role="img" {...props}> | ||
<g fill="#7a7a7a"> | ||
<path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0" /> | ||
<path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0" /> | ||
</g> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default IconArrow; |
33 changes: 33 additions & 0 deletions
33
packages/docusaurus-theme-classic/src/theme/IconEdit/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import clsx from 'clsx'; | ||
|
||
import {Props} from '@theme/IconEdit'; | ||
|
||
import styles from './styles.module.css'; | ||
|
||
const IconEdit = ({className, ...restProps}: Props): JSX.Element => { | ||
return ( | ||
<svg | ||
fill="currentColor" | ||
height="1.2em" | ||
width="1.2em" | ||
preserveAspectRatio="xMidYMid meet" | ||
role="img" | ||
viewBox="0 0 40 40" | ||
className={clsx(styles.iconEdit, className)} | ||
{...restProps}> | ||
<g> | ||
<path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z" /> | ||
</g> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default IconEdit; |
11 changes: 11 additions & 0 deletions
11
packages/docusaurus-theme-classic/src/theme/IconEdit/styles.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
.iconEdit { | ||
margin-right: 0.3em; | ||
vertical-align: sub; | ||
} |
39 changes: 39 additions & 0 deletions
39
packages/docusaurus-theme-classic/src/theme/IconMenu/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import {Props} from '@theme/IconMenu'; | ||
|
||
const IconMenu = ({ | ||
width = 30, | ||
height = 30, | ||
className, | ||
...restProps | ||
}: Props): JSX.Element => { | ||
return ( | ||
<svg | ||
aria-label="Menu" | ||
className={className} | ||
width={width} | ||
height={height} | ||
viewBox="0 0 30 30" | ||
role="img" | ||
focusable="false" | ||
{...restProps}> | ||
<title>Menu</title> | ||
<path | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeMiterlimit="10" | ||
strokeWidth="2" | ||
d="M4 7h22M4 15h22M4 23h22" | ||
/> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default IconMenu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters