Skip to content

Commit abe3472

Browse files
Update styling (#1335)
closes #1324 ## Changes for CCP editor projects ### Heading - **_Editor-ui_**: The blue box and squiggly line for heading are used only for projects site editor projects. So it is safe to remove. - In the past, projects site heading was styled using a css class. Going forward, it will be pure markdown h2. - There was a blanket removal of margin from h2 in `instructions.scss` which made the markdown h2 look strange. - **_Editor-ui_**: This was replaced with different margin. This doesn't affect CEfE instructions. - Task fencing (--- task ---) no longer needed so removed from .md file. - Need to keep`.c-project-task` css class for existing projects that contain the task fencing. ### Steps - Used markdown h3 in .md file. - With that, they get `id = step-1` etc. probably by kramdown during project build - **_Editor-ui_**: Added CCP styling for the steps ids ### 'Now run your code` - Used markdown h3 in .md file - With that, it gets `id = now-run-your-code` - **_Editor-ui_**: Added styling for the id ### Callouts - No changes in the editor-ui. - Instead of using html, used kramdown syntax to set classes in .md file -> worked! ## Screenshots Before - After (with existing .md format) - After (with new .md format) <img width="931" alt="Screenshot 2026-02-23 at 11 09 35" src="https://github.com/user-attachments/assets/52c549c5-d825-4aea-ad40-6a9eb7fa7688" /> ## Impact on CEfE instructions panel? CEfE instructions panel does use the `.project-instructions` class with markdowns; however, the markdown headings don't get ids when used to populate the instruction panel. So there won't be any impact on CEfE. --------- Co-authored-by: create-issue-branch[bot] <53036503+create-issue-branch[bot]@users.noreply.github.com> Co-authored-by: cocomarine <hj.kang@raspberrypi.org> Co-authored-by: HJ <cocomarine@users.noreply.github.com>
1 parent d4a76ea commit abe3472

File tree

2 files changed

+42
-25
lines changed

2 files changed

+42
-25
lines changed

src/assets/play_filled.svg

Lines changed: 3 additions & 0 deletions
Loading

src/assets/stylesheets/Instructions.scss

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
h2 {
1111
@include typography.style-1-5(bold);
12-
margin: 0;
12+
margin-block-start: $space-0-5;
1313
}
1414

1515
p {
@@ -67,6 +67,43 @@
6767
}
6868
}
6969

70+
// Steps in CCP style
71+
[id^="step-"]{
72+
@include typography.style-1(bold);
73+
74+
background: #ECF8EE;
75+
border-radius: $space-0-5;
76+
color: #276D32;
77+
display: inline-block;
78+
margin: $space-1-5 0 0 0;
79+
padding: $space-0-25 $space-0-5;
80+
}
81+
82+
// "Now run your code" in CCP style
83+
#now-run-your-code {
84+
@include typography.style-1(bold);
85+
86+
padding-inline-start: $space-2-5;
87+
margin-block-start: $space-2;
88+
position: relative;
89+
90+
&::before {
91+
content: "";
92+
position: absolute;
93+
inset-inline-start: 0;
94+
top: 50%;
95+
transform: translateY(-50%);
96+
block-size: $space-2;
97+
inline-size: $space-2;
98+
border-radius: $space-0-5;
99+
background-color: #ECF8EE;
100+
background-image: url("../play_filled.svg");
101+
background-repeat: no-repeat;
102+
background-position: center;
103+
background-size: $space-1-5 $space-1-5;
104+
}
105+
}
106+
70107
.c-project-code {
71108
background-color: $rpf-grey-700;
72109
border-radius: 8px;
@@ -202,31 +239,8 @@
202239
}
203240
}
204241

205-
.c-project-heading--task {
206-
@extend .rpf-squiggle-heading;
207-
--rpf-squiggle-color: var(--rpf-blue-800);
208-
background-color: $rpf-blue-100;
209-
padding: $space-1;
210-
inline-size: 100%;
211-
box-sizing: border-box;
212-
border-start-start-radius: 8px;
213-
border-start-end-radius: 8px;
214-
215-
&::after {
216-
margin-inline: $space-1;
217-
margin-block-start: $space-0-25;
218-
}
219-
}
220-
221242
.c-project-task {
222-
background-color: $rpf-blue-100;
223-
padding: $space-1;
224-
display: flex;
225-
flex-direction: column;
226-
gap: $space-1;
227-
border-end-start-radius: 8px;
228-
border-end-end-radius: 8px;
229-
margin-block-end: $space-1-5;
243+
margin-block-end: $space-2-5;
230244

231245
p {
232246
margin: 0;

0 commit comments

Comments
 (0)