Skip to content

Commit 7e6605e

Browse files
authored
Merge pull request #2102 from tf/text-inline-rights-tweaks
Improve text inline file rights
2 parents b1f0519 + 4bc538e commit 7e6605e

File tree

3 files changed

+53
-24
lines changed

3 files changed

+53
-24
lines changed

entry_types/scrolled/package/src/frontend/Section.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,21 @@ const Section = withInlineEditingDecorator('SectionDecorator', function Section(
6060
<SectionLifecycleProvider onActivate={onActivate}
6161
entersWithFadeTransition={section.transition?.startsWith('fade')}>
6262
<SectionViewTimelineProvider backdrop={backdrop}>
63-
<SectionAtmo audioFile={atmoAudioFile} />
64-
65-
<SectionContents section={section}
66-
transitions={transitions}
67-
backdrop={backdrop}
68-
contentElements={contentElements}
69-
state={state}
70-
transitionStyles={transitionStyles} />
71-
72-
<SectionInlineFileRights section={section}
73-
backdrop={backdrop}
74-
atmoAudioFile={atmoAudioFile}
75-
state={state} />
63+
<BackgroundColorProvider dark={!section.invert}>
64+
<SectionAtmo audioFile={atmoAudioFile} />
65+
66+
<SectionContents section={section}
67+
transitions={transitions}
68+
backdrop={backdrop}
69+
contentElements={contentElements}
70+
state={state}
71+
transitionStyles={transitionStyles} />
72+
73+
<SectionInlineFileRights section={section}
74+
backdrop={backdrop}
75+
atmoAudioFile={atmoAudioFile}
76+
state={state} />
77+
</BackgroundColorProvider>
7678
</SectionViewTimelineProvider>
7779
</SectionLifecycleProvider>
7880
</section>
@@ -146,15 +148,13 @@ function SectionContents({
146148
state={state}
147149
motifAreaState={motifAreaState}
148150
staticShadowOpacity={staticShadowOpacity}>
149-
<BackgroundColorProvider dark={!section.invert}>
150-
<Layout sectionId={section.id}
151-
items={contentElements}
152-
appearance={section.appearance}
153-
contentAreaRef={setContentAreaRef}
154-
sectionProps={sectionProperties}>
155-
{(children, boxProps) => <BoxWrapper {...boxProps} inverted={section.invert}>{children}</BoxWrapper>}
156-
</Layout>
157-
</BackgroundColorProvider>
151+
<Layout sectionId={section.id}
152+
items={contentElements}
153+
appearance={section.appearance}
154+
contentAreaRef={setContentAreaRef}
155+
sectionProps={sectionProperties}>
156+
{(children, boxProps) => <BoxWrapper {...boxProps} inverted={section.invert}>{children}</BoxWrapper>}
157+
</Layout>
158158
</Box>
159159
</Foreground>
160160
</>

entry_types/scrolled/package/src/widgets/textInlineFileRights/TextInlineFileRights.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import React from 'react';
22
import classNames from 'classnames';
3+
import {useDarkBackground} from 'pageflow-scrolled/frontend';
34

45
import styles from './TextInlineFileRights.module.css';
56

67
export function TextInlineFileRights({context, children}) {
8+
const darkBackground = useDarkBackground();
9+
710
if (context === 'insideElement' || context === 'playerControls') {
811
return null;
912
}
1013

1114
return (
1215
<div className={classNames(styles.text,
13-
{[styles.forSection]: context === 'section'})}>
16+
{[styles.forSection]: context === 'section',
17+
[styles.darkBackground]: darkBackground})}>
1418
<div>
1519
{children}
1620
</div>

entry_types/scrolled/package/src/widgets/textInlineFileRights/TextInlineFileRights.module.css

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
@value (
2+
darkContentSurfaceColor, lightContentSurfaceColor,
3+
darkContentTextColor, lightContentTextColor,
4+
contentColorScope
5+
) from "pageflow-scrolled/values/colors.module.css";
6+
17
.text {
28
font-size: 14px;
39
position: relative;
@@ -10,14 +16,33 @@
1016
padding-top: 0.2em;
1117
}
1218

19+
.text li::before {
20+
content: "© ";
21+
opacity: 0.7;
22+
}
23+
24+
.text:not(:has(li:nth-child(2))) span {
25+
display: none;
26+
}
27+
1328
.forSection {
1429
position: absolute;
1530
bottom: 0;
1631
right: 0;
1732
}
1833

1934
.forSection li {
20-
padding: 0 0.4em 0.2em 0;
35+
padding: 0.1em 0.3em;
36+
border-radius: 0.25rem;
37+
margin: 0 0.2em 0.1em auto;
38+
background-color: color-mix(in srgb, lightContentSurfaceColor, transparent);
39+
color: darkContentTextColor;
40+
width: fit-content;
41+
}
42+
43+
.forSection.darkBackground li {
44+
background-color: color-mix(in srgb, darkContentSurfaceColor, transparent);
45+
color: lightContentTextColor;
2146
}
2247

2348
.text a {

0 commit comments

Comments
 (0)