Skip to content

feat(): Introduce Note component #77

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

Merged
merged 2 commits into from
Sep 27, 2019
Merged
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
27 changes: 27 additions & 0 deletions src/_includes/components/note.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<div class="note">
{% if include.title %}
<div class="note__header">
<span class="note__icon">
{% include_relative assets/icons/alerts/info-note.svg %}
</span>

<h4>{{ include.title }}</h4>
</div>

<div class="note__text">
{{ include.content | markdownify }}
{% include components/button-link.html text=include.buttonTitle href=include.buttonHref %}
</div>
{% else %}
<div class="note__content">
<span class="note__icon">
{% include_relative assets/icons/alerts/info-note.svg %}
</span>

<div class="note__text">
<span class="note__heading">NOTE:</span> {{ include.content | markdownify }}
{% include components/button-link.html text=include.buttonTitle href=include.buttonHref %}
</div>
</div>
{% endif %}
</div>
43 changes: 43 additions & 0 deletions src/_sass/components/_note.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.note {
padding: 24px 24px 24px 16px;
background-color: color(gray-light);
border-radius: 8px;
font-size: 14px;
line-height: 22px;

& > * + * {
margin-top: 5px;
}

&__header {
display: flex;

& > * + * {
margin-left: 10px;
}
}

&__content {
display: flex;

& > * + * {
margin-left: 20px;
}
}

&__text {
& > * {
display: inline;
}
}

&__heading {
color: color(secondary);
font-weight: 700;
}

&__icon {
width: 16px;
height: 16px;
}
}
1 change: 1 addition & 0 deletions src/_sass/segment.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
// =================================================
@import "components/stage";
@import "components/logo";
@import "components/note";
@import "components/button-link";

// Pages
Expand Down
1 change: 1 addition & 0 deletions src/assets/icons/alerts/info-note.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: 12 additions & 2 deletions src/styleguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ hidden: true
layout: page
---

{% include components/button-link.html text="Find out more" href="https://segment.com" %}

# Heading 1
## Heading 2
### Heading 3
Expand All @@ -27,3 +25,15 @@ layout: page
- Subitem
- Subitem
* Item

{% include components/button-link.html text="Find out more" href="https://segment.com" %}

{% capture note %}
Our [browser and mobile libraries](https://segment.com) **automatically** use Anonymous IDs under the covers to keep track of users as they navigate around your website or app, so you don’t need to worry about them when using those libraries.
{% endcapture %}
{% include components/note.html content=note %}

{% capture server_side_tracking %}
Server-side data management is when tag sends data into your web server, then your web server passes that data to the destination system/server.
{% endcapture %}
{% include components/note.html title="Server-side tracking" content=server_side_tracking buttonTitle="Find out more" buttonHref="https://segment.com" %}