Skip to content

style custom paragraphs on webview #323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

* Create files for custom paragraphs for `webview`
* Style `horizontal rule for vertically-tight tables` in `nursing-external`
* Style `multipart questions` in `bca`
* Style `safetey-alert title color` in `nursing-internal`
Expand Down
44 changes: 44 additions & 0 deletions styles/books/generic/webview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,40 @@
),
));

@include add_settings((
ParaAnnotationWithIcon: (
_selectors: ('p.annotation'),
),
CultureAnnotationIcon:(
_selectors: ("span.culture-icon"),
'ParaAnnotationIcon:::background': url("https://raw.githubusercontent.com/openstax/rex-web/main/public/static/icons/cosmos-culture.svg") no-repeat top left
),
LinguisticAnnotationIcon: (
_selectors: ("span.linguistic-icon"),
'ParaAnnotationIcon:::background': url(toDataUri("svg+xml", "designs/webview/resources/cosmos-linguistic.svg")) no-repeat top left
),
DreamingAnnotationIcon: (
_selectors: ("span.dreaming-icon"),
'ParaAnnotationIcon:::background': url(toDataUri("svg+xml", "designs/webview/resources/cosmos-dreaming.svg")) no-repeat top left
),
VisualAnnotationIcon: (
_selectors: ("span.visual-icon"),
'ParaAnnotationIcon:::background': url(toDataUri("svg+xml", "designs/webview/resources/cosmos-visual.svg")) no-repeat top left
),
SpeechAnnotationIcon: (
_selectors: ("span.speech-icon"),
'ParaAnnotationIcon:::background': url(toDataUri("svg+xml", "designs/webview/resources/cosmos-speech.svg")) no-repeat top left
),
AuditoryAnnotationIcon: (
_selectors: ("span.auditory-icon"),
'ParaAnnotationIcon:::background': url(toDataUri("svg+xml", "designs/webview/resources/cosmos-auditory.svg")) no-repeat top left
),
KinestheticAnnotationIcon: (
_selectors: ("span.kinesthetic-icon"),
'ParaAnnotationIcon:::background': url(toDataUri("svg+xml", "designs/webview/resources/cosmos-kinesthetic.svg")) no-repeat top left
),
));

@include add_settings((
AnswerKey: (
_selectors: ('.os-eob.os-solutions-container'),
Expand Down Expand Up @@ -451,6 +485,16 @@
@include use('PurpleColoredText', 'webview:::ColoredText');
@include use('BlueColoredText', 'webview:::ColoredText');

// Custom paragraphs
@include use('ParaAnnotationWithIcon', 'webview:::ParaAnnotationWithIconShape');
@include use('CultureAnnotationIcon', 'webview:::ParaAnnotationIconShape');
@include use('LinguisticAnnotationIcon', 'webview:::ParaAnnotationIconShape');
@include use('DreamingAnnotationIcon', 'webview:::ParaAnnotationIconShape');
@include use('VisualAnnotationIcon', 'webview:::ParaAnnotationIconShape');
@include use('SpeechAnnotationIcon', 'webview:::ParaAnnotationIconShape');
@include use('AuditoryAnnotationIcon', 'webview:::ParaAnnotationIconShape');
@include use('KinestheticAnnotationIcon', 'webview:::ParaAnnotationIconShape');

// EOC
@include use('WorksCited', 'webview:::ModuleWithIndentationShape');
@include use('SectionWorksCited', 'webview:::ModuleWithIndentationShape');
Expand Down
1 change: 1 addition & 0 deletions styles/design-settings/webview/_design.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
@import '../../designs/webview/parts/coloredText-shapes';
@import '../../designs/webview/parts/module-shapes';
@import '../../designs/webview/parts/answerkey-shapes';
@import '../../designs/webview/parts/customPara-shapes';
30 changes: 30 additions & 0 deletions styles/designs/webview/parts/_customPara-components.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Annotation with Icon

$Para--Annotation--WithIcon: (
_name: "ParaAnnotationWithIcon",
_subselector: '',
_properties:(
)
);

$Para--Annotation__IconContainer: (
_name: "ParaAnnotationIconContainer",
_subselector: ' > .os-icons',
_properties:(
display: flex,
float: left,
)
);

$Para--Annotation__Icon: (
_name: "ParaAnnotationIcon",
_subselector: '',
_properties:(
height: 2rem,
width: 2rem,
background: enum('ValueSet:::REQUIRED'),
content: "''",
background-repeat: no-repeat,
margin: '0.15rem 1rem 0.15rem 0',
)
);
19 changes: 19 additions & 0 deletions styles/designs/webview/parts/_customPara-shapes.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@import './customPara-components';

// Annotation with Icon

@include create_shape('webview:::ParaAnnotationWithIconShape', (
_components: (
map-merge($Para--Annotation--WithIcon,(
_components: (
$Para--Annotation__IconContainer,
),
))
),
));

@include create_shape('webview:::ParaAnnotationIconShape', (
_components: (
$Para--Annotation__Icon,
)
));
21 changes: 21 additions & 0 deletions styles/designs/webview/resources/cosmos-auditory.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions styles/designs/webview/resources/cosmos-culture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions styles/designs/webview/resources/cosmos-dreaming.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions styles/designs/webview/resources/cosmos-kinesthetic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions styles/designs/webview/resources/cosmos-linguistic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions styles/designs/webview/resources/cosmos-speech.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions styles/designs/webview/resources/cosmos-visual.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading