Skip to content
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

Add user message styles #155

Merged
merged 6 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
Binary file added docs/static/usermessage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions docs/styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
- [Accordion](#accordion-os-raise-accordion)
- [Student Reflection Box](#student-reflection-box)
- [Family Support Materials Links](#family-support-materials-links)
- [User Message Link and Lightbulb](#user-message-link-and-lightbulb)

* Text Styling
- [Bold Text](#bold-text)
- [Italicize Text](#italicize-text)
Expand Down Expand Up @@ -914,6 +916,31 @@ Family support materials links should only be used in `<div>` elements. There sh
</div>
```

## User Message Link and Lightbulb

Add a user message box with a link or lightbulb icon.

**Examples**

<div style="text-align: center;">
<img src="./static/usermessage.png" width="750">
</div>

**Availability**

User message should only be used in `<div>` elements. The user message should only
have a `<p>` tag and `<a>` tags.

**Usage**
```html
<div class="os-raise-usermessage-link">
<p>Use this link to access the activity: <a href="">Desmos Activity: RAISE 3.5.1 Using Bivariate Data in Context</a></p>
</div>
<div class="os-raise-usermessage-lightbulb">
<p>Use this link to access the activity: <a href="">Desmos Activity: RAISE 3.5.1 Using Bivariate Data in Context</a></p>
</div>
```

---

# Flex
Expand Down
42 changes: 42 additions & 0 deletions src/styles/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -461,3 +461,45 @@ $arrow-svg: url("data:image/svg+xml,%3Csvg width='16' height='9' viewBox='0 0 16
font-size: .875rem;
margin-bottom: 0;
}

// User Message
.os-raise-usermessage-link {
display: flex;
align-items: center;
border: .125rem solid $os-dark-green;
border-radius: .5rem;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3Cpath fill='%230a5b50' d='M10.59 13.41c.41.39.41 1.03 0 1.42c-.39.39-1.03.39-1.42 0a5.003 5.003 0 0 1 0-7.07l3.54-3.54a5.003 5.003 0 0 1 7.07 0a5.003 5.003 0 0 1 0 7.07l-1.49 1.49c.01-.82-.12-1.64-.4-2.42l.47-.48a2.98 2.98 0 0 0 0-4.24a2.98 2.98 0 0 0-4.24 0l-3.53 3.53a2.98 2.98 0 0 0 0 4.24m2.82-4.24c.39-.39 1.03-.39 1.42 0a5.003 5.003 0 0 1 0 7.07l-3.54 3.54a5.003 5.003 0 0 1-7.07 0a5.003 5.003 0 0 1 0-7.07l1.49-1.49c-.01.82.12 1.64.4 2.43l-.47.47a2.98 2.98 0 0 0 0 4.24a2.98 2.98 0 0 0 4.24 0l3.53-3.53a2.98 2.98 0 0 0 0-4.24a.973.973 0 0 1 0-1.42'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: 1rem 50%;
background-size: 1.5rem;
min-height: 3.5rem;
padding-left: 3.5rem;
margin-bottom: 1rem;

}

.os-raise-usermessage-lightbulb {
display: flex;
align-items: center;
border: .125rem solid $os-dark-green;
border-radius: .5rem;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3Cpath fill='%230a5b50' d='M20 11h3v2h-3zM1 11h3v2H1zM13 1v3h-2V1zM4.92 3.5l2.13 2.14l-1.42 1.41L3.5 4.93zm12.03 2.13l2.12-2.13l1.43 1.43l-2.13 2.12zM12 6a6 6 0 0 1 6 6c0 2.22-1.21 4.16-3 5.2V19a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1v-1.8c-1.79-1.04-3-2.98-3-5.2a6 6 0 0 1 6-6m2 15v1a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-1zm-3-3h2v-2.13c1.73-.44 3-2.01 3-3.87a4 4 0 0 0-4-4a4 4 0 0 0-4 4c0 1.86 1.27 3.43 3 3.87z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: 1rem 50%;
background-size: 1.5rem;
min-height: 3.5rem;
padding-left: 3.5rem;
margin-bottom: 1rem;

}

.os-raise-usermessage-link p, .os-raise-usermessage-lightbulb p {
color: $raise-light-black;
font-weight: 700;
font-size: .875rem;
margin-bottom: 0;
}
rnathuji marked this conversation as resolved.
Show resolved Hide resolved

.os-raise-usermessage-link a, .os-raise-usermessage-lightbulb a {
text-decoration: underline;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're introducing a bit of asymmetry here as it relates to styling links in these boxes:

image

Can we confirm with UX whether ☝️ is intentional, or if we should be adding .os-raise-familysupport here like:

.os-raise-usermessage-link a,
.os-raise-usermessage-lightbulb a,
.os-raise-familysupport a {
  text-decoration: underline;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@madisonschear Do we want to add the underline text decoration to the links in the family support box?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they should be underlined. Thank you @rnathuji good catch!

Loading