Skip to content

Commit 1e2d4b0

Browse files
committed
Enhance RichText styles
1 parent 6ec0274 commit 1e2d4b0

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

wp-content/themes/pub/wporg-learn-2024/src/lesson-facilitator-notes/index.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,12 @@ registerBlockType( metadata.name, {
9595
? __( 'Collapse Content', 'wporg-learn' )
9696
: __( 'Expand Content', 'wporg-learn' ) }
9797
</Button>
98-
<div
99-
style={ {
100-
maxHeight: isExpanded ? 'none' : '100px', // Adjust the height as needed
101-
overflow: 'hidden',
102-
transition: 'max-height 0.3s ease',
103-
} }
104-
>
105-
<RichText
106-
label={ __( 'Edit Lesson Plan Content', 'wporg-learn' ) }
107-
value={ lessonPlanContent }
108-
onChange={ ( newContent ) => setAttributes( { lessonPlanContent: newContent } ) }
109-
/>
110-
</div>
98+
<RichText
99+
className={ isExpanded ? 'is-expanded' : 'is-collapsed' }
100+
label={ __( 'Edit Lesson Plan Content', 'wporg-learn' ) }
101+
value={ lessonPlanContent }
102+
onChange={ ( newContent ) => setAttributes( { lessonPlanContent: newContent } ) }
103+
/>
111104
</>
112105
) }
113106
{ lessonPlanId && (
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
.wp-block-wporg-learn-lesson-facilitator-notes {
2+
.components-base-control__field {
3+
margin-bottom: var(--wp--preset--spacing--10);
4+
}
5+
26
.block-editor-rich-text__editable {
37
white-space: unset !important;
8+
overflow: scroll;
9+
border: 1px solid var(--wp--preset--color--charcoal-5);
10+
margin: var(--wp--preset--spacing--10) 0;
11+
padding: var(--wp--preset--spacing--10) 0;
12+
13+
&.is-expanded {
14+
max-height: none;
15+
}
16+
17+
&.is-collapsed {
18+
max-height: 300px;
19+
}
420
}
521
}

0 commit comments

Comments
 (0)