generated from KevinBatdorf/gutenberg-rust-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from KevinBatdorf/add-language-name-headers
Add additional headers
- Loading branch information
Showing
16 changed files
with
250 additions
and
65 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Attributes } from '../../../types'; | ||
|
||
export const Headlights = ({ bgColor }: Partial<Attributes>) => ( | ||
<span | ||
style={{ | ||
display: 'block', | ||
padding: '16px 0 0 16px', | ||
marginBottom: '-1px', | ||
width: '100%', | ||
textAlign: 'left', | ||
backgroundColor: bgColor, | ||
}}> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width={54} | ||
height={14} | ||
viewBox="0 0 54 14"> | ||
<g fill="none" fillRule="evenodd" transform="translate(1 1)"> | ||
<circle | ||
cx="6" | ||
cy="6" | ||
r="6" | ||
fill="#FF5F56" | ||
stroke="#E0443E" | ||
strokeWidth=".5"></circle> | ||
<circle | ||
cx="26" | ||
cy="6" | ||
r="6" | ||
fill="#FFBD2E" | ||
stroke="#DEA123" | ||
strokeWidth=".5"></circle> | ||
<circle | ||
cx="46" | ||
cy="6" | ||
r="6" | ||
fill="#27C93F" | ||
stroke="#1AAB29" | ||
strokeWidth=".5"></circle> | ||
</g> | ||
</svg> | ||
</span> | ||
); |
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,59 @@ | ||
import { colord, AnyColor } from 'colord'; | ||
import { Attributes } from '../../../types'; | ||
|
||
export const HeadlightsMuted = ({ | ||
textColor, | ||
bgColor, | ||
}: Partial<Attributes>) => ( | ||
<span | ||
style={{ | ||
display: 'block', | ||
padding: '16px 0 0 16px', | ||
marginBottom: '-1px', | ||
width: '100%', | ||
textAlign: 'left', | ||
backgroundColor: bgColor, | ||
}}> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width={54} | ||
height={14} | ||
viewBox="0 0 54 14"> | ||
<g fill="none" fillRule="evenodd" transform="translate(1 1)"> | ||
<circle | ||
cx="6" | ||
cy="6" | ||
r="6" | ||
fill={colord(textColor as AnyColor) | ||
.alpha(0.2) | ||
.toHex()} | ||
stroke={colord(textColor as AnyColor) | ||
.alpha(0.3) | ||
.toHex()} | ||
strokeWidth=".5"></circle> | ||
<circle | ||
cx="26" | ||
cy="6" | ||
r="6" | ||
fill={colord(textColor as AnyColor) | ||
.alpha(0.2) | ||
.toHex()} | ||
stroke={colord(textColor as AnyColor) | ||
.alpha(0.3) | ||
.toHex()} | ||
strokeWidth=".5"></circle> | ||
<circle | ||
cx="46" | ||
cy="6" | ||
r="6" | ||
fill={colord(textColor as AnyColor) | ||
.alpha(0.2) | ||
.toHex()} | ||
stroke={colord(textColor as AnyColor) | ||
.alpha(0.3) | ||
.toHex()} | ||
strokeWidth=".5"></circle> | ||
</g> | ||
</svg> | ||
</span> | ||
); |
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,49 @@ | ||
import { colord, AnyColor } from 'colord'; | ||
import { Attributes } from '../../../types'; | ||
|
||
export const HeadlightsMutedAlt = ({ bgColor }: Partial<Attributes>) => { | ||
const bgC = colord(bgColor as AnyColor); | ||
const bg = bgC.isDark() ? bgC.lighten(0.05) : bgC.darken(0.05); | ||
return ( | ||
<span | ||
style={{ | ||
display: 'flex', | ||
alignItems: 'center', | ||
padding: '10px 0px 10px 16px', | ||
marginBottom: '-2px', | ||
width: '100%', | ||
textAlign: 'left', | ||
backgroundColor: bg.toHex(), | ||
}}> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width={62} | ||
height={20} | ||
viewBox="0 0 62 20"> | ||
<g fill="none" fillRule="evenodd" transform="translate(1 1)"> | ||
<circle | ||
cx="8" | ||
cy="8" | ||
r="8" | ||
fill={bgColor} | ||
stroke={bgColor} | ||
strokeWidth=".5"></circle> | ||
<circle | ||
cx="30" | ||
cy="8" | ||
r="8" | ||
fill={bgColor} | ||
stroke={bgColor} | ||
strokeWidth=".5"></circle> | ||
<circle | ||
cx="52" | ||
cy="8" | ||
r="8" | ||
fill={bgColor} | ||
stroke={bgColor} | ||
strokeWidth=".5"></circle> | ||
</g> | ||
</svg> | ||
</span> | ||
); | ||
}; |
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,31 @@ | ||
import { colord, AnyColor } from 'colord'; | ||
import { Lang } from 'shiki'; | ||
import { Attributes } from '../../../types'; | ||
import { languages } from '../../../util/languages'; | ||
|
||
export const SimpleString = ({ | ||
language, | ||
bgColor, | ||
textColor, | ||
headerString, | ||
}: Partial<Attributes>) => { | ||
const bgC = colord(bgColor as AnyColor); | ||
const bg = bgC.isDark() ? bgC.lighten(0.05) : bgC.darken(0.05); | ||
const textC = colord(textColor as AnyColor); | ||
const text = textC.isDark() ? textC.lighten(0.05) : textC.darken(0.05); | ||
return ( | ||
<span | ||
style={{ | ||
display: 'flex', | ||
alignItems: 'center', | ||
padding: '10px 0px 10px 16px', | ||
marginBottom: '-2px', | ||
width: '100%', | ||
textAlign: 'left', | ||
backgroundColor: bg.toHex(), | ||
color: text.toHex(), | ||
}}> | ||
{headerString || languages[language as Lang]} | ||
</span> | ||
); | ||
}; |
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
Oops, something went wrong.