Skip to content

Commit

Permalink
add lifecycle badge component (#4528)
Browse files Browse the repository at this point in the history
creating a lifecycle badge to enable the docs team and documentarians to
use a component allowing them to add a lifecycle badge on specific
content.
  • Loading branch information
mirnawong1 authored Nov 27, 2023
2 parents 1a1240c + dd956f9 commit 587c12d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions website/docs/docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pagination_next: null
pagination_prev: null
---


<Snippet path="what-is-dbt-intro" />

dbt compiles and runs your analytics code against your data platform, enabling you and your team to collaborate on a single source of truth for metrics, insights, and business definitions. This single source of truth, combined with the ability to define tests for your data, reduces errors when logic changes, and alerts you when issues arise.
Expand Down
11 changes: 11 additions & 0 deletions website/src/components/lifeCycle/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'
import styles from './styles.module.css';

export default function Lifecycle(props) {
if (!props.status) {
return null;
}
return (
<span className={styles.lifecycle}>{props.status}</span>
);
}
13 changes: 13 additions & 0 deletions website/src/components/lifeCycle/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.lifecycle {
background-color: #047377; /* Teal background to align with dbt Labs' color */
color: #fff; /* Light text color for contrast */
font-size: 0.78rem; /* Using rem so font size is relative to root */
padding: 1px 8px; /* Adjust padding for a more pill-like shape */
border-radius: 16px; /* Larger border-radius for rounded edges */
margin-left: 8px; /* Margin to separate from the header text */
vertical-align: middle; /* Align with the title */
display: inline-block; /* Use inline-block for better control */
font-weight: bold; /* Bold text */
text-transform: capitalize; /* Uppercase text */
line-height: 1.6; /* Adjust line height for vertical alignment */
}
2 changes: 2 additions & 0 deletions website/src/theme/MDXComponents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import CommunitySpotlightCard from '@site/src/components/communitySpotlightCard'
import CommunitySpotlightList from '@site/src/components/communitySpotlightList';
import dbtEditor from '@site/src/components/dbt-editor';
import Icon from '@site/src/components/icon';
import Lifecycle from '@site/src/components/lifeCycle';

const MDXComponents = {
head: MDXHead,
Expand Down Expand Up @@ -90,5 +91,6 @@ const MDXComponents = {
CommunitySpotlightList,
dbtEditor: dbtEditor,
Icon: Icon,
Lifecycle: Lifecycle,
};
export default MDXComponents;

0 comments on commit 587c12d

Please sign in to comment.