Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commite91c9f8

Browse files
committed
feat(editor): add custom embedly styles
1 parent89baa42 commite91c9f8

File tree

3 files changed

+67
-6
lines changed

3 files changed

+67
-6
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
*
3+
* embed.ly custom styles, those styles only works in paid user of embed.ly
4+
* see details in: https://docs.embed.ly/docs/cards
5+
*
6+
*/
7+
constgetEmbedHeadStyle=themeData=>{
8+
const{
9+
providerName,
10+
title,
11+
digest,
12+
selectionBg,
13+
selectionFg,
14+
link,
15+
linkHover,
16+
}=themeData.richEditor.embed
17+
18+
return`
19+
.card .title {
20+
margin-top: 15px;
21+
}
22+
.card .title a {
23+
color:${title};
24+
}
25+
.card .description {
26+
color:${digest};
27+
margin-top: 10px;
28+
margin-bottom: 10px;
29+
}
30+
.card .action {
31+
color:${link};
32+
}
33+
.card .meta .meta-txt a:hover, .card .action:hover, .modal-container .preview-overlay-txt:hover, .modal-container .reset-embed-btn:hover, .modal-container .code-txt-label a:hover, .modal-container .services-list li a:hover, .modal-container .resources-list li a:hover, .slideshow .action:hover {
34+
color:${linkHover};
35+
}
36+
.card .provider-name {
37+
color:${providerName};
38+
}
39+
.no-touch .card .provider-name:hover, .touch .card .provider-name {
40+
border-bottom: 1px dotted${providerName};
41+
}
42+
::selection {
43+
background:${selectionBg};
44+
color:${selectionFg};
45+
}
46+
`
47+
}
48+
49+
exportdefaultgetEmbedHeadStyle

‎src/containers/ThemeWrapper/index.js‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { connectStore } from '@utils'
1212
import{usePlatform}from'@hooks'
1313

1414
// import MarkDownStyle from './MarkDownStyle'
15+
importgetEmbedHeadStylefrom'./EditorEmbedCustom'
1516
importCodeSyxHighlightfrom'./CodeSyxHighlight'
1617
importAntUIOverWritefrom'./AntUIOverWrite'
1718
importGlobalStylefrom'./GlobalStyle'
@@ -25,11 +26,9 @@ const ThemeContainer = ({ children, theme: { themeData } }) => {
2526
<ThemeProvidertheme={themeData}>
2627
<React.Fragment>
2728
<Helmetmeta={[{name:'theme-color',content:themeData.mobileTab}]}>
28-
<styleclassName="embedly-css">{`
29-
.card .title {
30-
margin-top: 5px;
31-
}
32-
`}</style>
29+
<styleclassName="embedly-css">{`${getEmbedHeadStyle(
30+
themeData
31+
)}`}</style>
3332
</Helmet>
3433
<div>{children}</div>
3534
<CodeSyxHighlight/>

‎utils/themes/skins/cyan.js‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ const markdownFont = '#7698A0'
1616
constdescText='#a3bbbd'
1717
constprimaryMate='orange'
1818

19+
constselectionBg='#FEDEB6'
20+
constselectionFg='#251A1A'
21+
1922
constcyan={
2023
name:'cyan',
2124
logoText:descText,
@@ -38,7 +41,7 @@ const cyan = {
3841
link:'orange',
3942
main:'#7DC0C5',
4043
bodyBg:contentBg,
41-
selectionBg:'#A0BBBC',
44+
selectionBg,
4245
avatarOpacity:1,
4346
baseColor:{
4447
error:'#fd7f68 !important',
@@ -261,6 +264,16 @@ const cyan = {
261264
taskDone:'#528416',
262265
taskPeding:darken(0.1,contentBoxBg),
263266
br:'#e8e8e8',
267+
// embed
268+
embed:{
269+
title:'#75979c',
270+
digest:'#75979c',
271+
selectionBg,
272+
selectionFg,
273+
link:'#dcb27c',
274+
linkHover:'#d49451',
275+
providerName:'#696565',
276+
},
264277
},
265278
code:{
266279
bg:darken(0.05,contentBoxBg),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp