Skip to content

Commit 6a1ced3

Browse files
committed
Merge pull request #18 from openstax/fix/styles-wrapping
no-conflict version of shared component styles
2 parents 6342067 + 5719158 commit 6a1ced3

33 files changed

+269
-220
lines changed

resources/styles/_components.less

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This file should be imported wrapped within another less file only.
2+
// Each of them begin with a `&-`, allowing whatever file that is importing
3+
// this file to easily namespace all the components at once.
4+
5+
@import './components/html/index';
6+
@import './components/exercise/step-card';
7+
@import './components/exercise/group';
8+
@import './components/breadcrumbs/step';
9+
@import './components/question';
10+
@import './components/close';
11+
@import './components/spy-mode';
12+
@import './components/smart-overflow';
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Note: Use tokens instead of strings to be able to do LESS compile-time validation
2+
.icon-feedback { .x-icon-bg(feedback); }
3+
.icon-exercise { .x-icon-bg(homework); }
4+
.icon-homework { .x-icon-bg(homework); }
5+
.icon-external { .x-icon-bg(external); }
6+
.icon-event { .x-icon-bg(event); }
7+
.icon-end { .x-icon-bg(end); }
8+
.icon-interactive { .x-icon-bg(interactive); }
9+
.icon-coach { .x-icon-bg(coach); }
10+
.icon-video { .x-icon-bg(video); }
11+
.icon-reading { .x-icon-bg(reading); }
12+
.icon-recover { .x-icon-bg(recover); }
13+
.icon-test { .x-icon-bg(test); }
14+
.icon-spaced_practice { .x-icon-bg(review); }
15+
.icon-personalized { .x-icon-bg(personalized); }
16+
.icon-worked-example { .x-icon-bg(worked-example); }
17+
18+
.icon-placeholder {
19+
&:before {
20+
content: '?';
21+
font-style: normal;
22+
}
23+
}
24+
// The following are usually overlays on other icons
25+
.icon-correct { .x-icon-bg(correct); }
26+
.icon-incorrect { .x-icon-bg(incorrect); }
Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
1-
.crumb-circle(@radius){
2-
font-size: @radius;
3-
border-radius: 2 * @radius;
4-
line-height: 2 * @radius;
5-
min-width: 2 * @radius;
6-
}
7-
8-
.crumb-text(){
9-
position: absolute;
10-
width: 100%;
11-
text-align: center;
12-
left: 0;
13-
}
14-
151
// http://caniuse.com/#search=counter
162
.task-homework,
173
.task-practice,
184
.task-chapter_practice,
5+
.task-concept_coach,
196
.task-page_practice {
207
.task-breadcrumbs {
218
counter-reset: step;
229
}
23-
.task-breadcrumbs-step:not(.end) {
10+
.openstax-breadcrumbs-step:not(.end) {
2411
&:before {
2512
counter-increment: step;
2613
content: counter(step);
@@ -34,7 +21,7 @@
3421

3522
// label readings with chapter info if it exists
3623
.task-reading {
37-
.task-breadcrumbs-step[data-chapter] {
24+
.openstax-breadcrumbs-step[data-chapter] {
3825

3926
background: @reading-color;
4027
color: @openstax-white;
@@ -59,7 +46,7 @@
5946
margin-right: -2px;
6047

6148
&.shrink {
62-
.task-breadcrumbs-step {
49+
.openstax-breadcrumbs-step {
6350
&:not(:hover):not(.active) {
6451
.scale(.75, .75);
6552
margin-left: -16px;
@@ -72,36 +59,3 @@
7259
}
7360
}
7461
}
75-
76-
.task-breadcrumbs-step {
77-
.crumb-circle(2rem);
78-
position: relative;
79-
font-weight: 500;
80-
cursor: pointer;
81-
margin: 2px;
82-
display: inline-block;
83-
text-align: center;
84-
background: @openstax-white;
85-
color: @openstax-neutral;
86-
87-
&:hover,
88-
&.active {
89-
.openstax-icon-active(1.4, 0.5);
90-
}
91-
92-
&.active {
93-
color: @openstax-primary;
94-
}
95-
&.completed {
96-
background: @openstax-answer-background;
97-
color: @openstax-answer-color;
98-
}
99-
&.status-correct {
100-
background: @openstax-correct-background;
101-
color: @openstax-correct-color;
102-
}
103-
&.status-incorrect {
104-
background: @openstax-incorrect-background;
105-
color: @openstax-incorrect-color;
106-
}
107-
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
&-breadcrumbs-step {
2+
3+
&.completed{
4+
.icon-end { .x-icon-bg(completed); }
5+
}
6+
7+
.crumb-circle(2rem);
8+
position: relative;
9+
font-weight: 500;
10+
cursor: pointer;
11+
margin: 2px;
12+
display: inline-block;
13+
text-align: center;
14+
background: @openstax-white;
15+
color: @openstax-neutral;
16+
17+
&:hover,
18+
&.active {
19+
.openstax-icon-active(1.4, 0.5);
20+
}
21+
22+
&.active {
23+
color: @openstax-primary;
24+
}
25+
&.completed {
26+
background: @openstax-answer-background;
27+
color: @openstax-answer-color;
28+
}
29+
&.status-correct {
30+
background: @openstax-correct-background;
31+
color: @openstax-correct-color;
32+
}
33+
&.status-incorrect {
34+
background: @openstax-incorrect-background;
35+
color: @openstax-incorrect-color;
36+
}
37+
}

resources/styles/components/close.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.close-x {
1+
&-close-x {
22
&::before {
33
content: "\00d7";
44
}

resources/styles/components/exercise/free-response.less

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
&-step-group {
2+
font-size: 1.6rem;
3+
color: @openstax-neutral;
4+
padding-top: 2rem;
5+
padding-bottom: 0;
6+
.opacity(0.5);
7+
8+
}
9+
10+
&-step-group-label {
11+
display: inline-block;
12+
margin-left: 4px;
13+
}

resources/styles/components/exercise/index.less

Lines changed: 0 additions & 24 deletions
This file was deleted.

resources/styles/components/exercise/modes.less

Whitespace-only changes.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
&-exercise {
2+
.exercise-typography();
3+
4+
@{placeholder-selector} {
5+
font-style: italic;
6+
}
7+
8+
textarea {
9+
width: 100%;
10+
min-height: 8em;
11+
line-height: 1.5em;
12+
margin: 1em 0;
13+
padding: 0.75em;
14+
15+
&[disabled] {
16+
border: none;
17+
}
18+
}
19+
20+
.exercise-uid {
21+
position: absolute;
22+
right: @answer-horizontal-spacing;
23+
bottom: @answer-vertical-spacing;
24+
color: @answer-label-color;
25+
font-size: 1.2rem;
26+
line-height: 1.2rem;
27+
}
28+
}
29+
30+
&-exercise-card {
31+
position: relative;
32+
}

0 commit comments

Comments
 (0)