aboutsummaryrefslogtreecommitdiff
path: root/src/services/user_highlighter/user_highlighter.js
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2021-09-07 16:15:41 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2021-09-07 16:15:41 +0000
commit8af1f08539d7c2863107bd3dfd36002b7558e252 (patch)
treea50006d11cdf6b834b49c2c98dc192609ba4471a /src/services/user_highlighter/user_highlighter.js
parent25a8b48bf28e1a0e0765f28221c5528f5854656b (diff)
parent4d73eaa6cef7a8b81bcca719755b11c05717d395 (diff)
Merge branch 'better-still-emoji' into 'develop'
Status HTML parsing - better emoji and mentions rendering Closes #935 See merge request pleroma/pleroma-fe!1392
Diffstat (limited to 'src/services/user_highlighter/user_highlighter.js')
-rw-r--r--src/services/user_highlighter/user_highlighter.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/services/user_highlighter/user_highlighter.js b/src/services/user_highlighter/user_highlighter.js
index b91c0f78..3b07592e 100644
--- a/src/services/user_highlighter/user_highlighter.js
+++ b/src/services/user_highlighter/user_highlighter.js
@@ -8,6 +8,11 @@ const highlightStyle = (prefs) => {
const solidColor = `rgb(${Math.floor(rgb.r)}, ${Math.floor(rgb.g)}, ${Math.floor(rgb.b)})`
const tintColor = `rgba(${Math.floor(rgb.r)}, ${Math.floor(rgb.g)}, ${Math.floor(rgb.b)}, .1)`
const tintColor2 = `rgba(${Math.floor(rgb.r)}, ${Math.floor(rgb.g)}, ${Math.floor(rgb.b)}, .2)`
+ const customProps = {
+ '--____highlight-solidColor': solidColor,
+ '--____highlight-tintColor': tintColor,
+ '--____highlight-tintColor2': tintColor2
+ }
if (type === 'striped') {
return {
backgroundImage: [
@@ -17,11 +22,13 @@ const highlightStyle = (prefs) => {
`${tintColor2} 20px,`,
`${tintColor2} 40px`
].join(' '),
- backgroundPosition: '0 0'
+ backgroundPosition: '0 0',
+ ...customProps
}
} else if (type === 'solid') {
return {
- backgroundColor: tintColor2
+ backgroundColor: tintColor2,
+ ...customProps
}
} else if (type === 'side') {
return {
@@ -31,7 +38,8 @@ const highlightStyle = (prefs) => {
`${solidColor} 2px,`,
`transparent 6px`
].join(' '),
- backgroundPosition: '0 0'
+ backgroundPosition: '0 0',
+ ...customProps
}
}
}