-
Notifications
You must be signed in to change notification settings - Fork 776
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add crosslink banner to carbon platform on homepage (#3185)
* feat: add crosslink banner to carbon platform on homepage * fix: remove calc from sass * Update Banner.module.scss * Update Banner.module.scss * Update Banner.js * Update Banner.module.scss * Update Banner.js * Update src/components/Banner/Banner.js Co-authored-by: Anna Gonzales <agonz@us.ibm.com> Co-authored-by: Anna Gonzales <agonz@us.ibm.com>
- Loading branch information
1 parent
f2ff211
commit a3326c0
Showing
4 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import { Button } from '@carbon/react'; | ||
import { ArrowRight } from '@carbon/react/icons'; | ||
|
||
import { | ||
banner, | ||
bannerText, | ||
bannerHeading, | ||
bannerDetails, | ||
buttonBanner, | ||
} from './Banner.module.scss'; | ||
|
||
const Banner = () => { | ||
return ( | ||
<div aria-label="banner" className={banner}> | ||
<p className={bannerText}> | ||
<strong className={bannerHeading}> | ||
A new web experience is coming! | ||
</strong> | ||
<span className={bannerDetails}> | ||
The v1 Carbon platform is now available in public beta. | ||
</span> | ||
</p> | ||
<Button | ||
href="https://next.carbondesignsystem.com" | ||
className={buttonBanner} | ||
kind="ghost" | ||
renderIcon={ArrowRight}> | ||
Try the Carbon Platform | ||
</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Banner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// position header, left nav and content with banner | ||
.banner + :global(.cds--header), | ||
.banner + header + nav + div[class*='leftNavWrapper'], | ||
.banner + header + nav + div + span + div + #main-content { | ||
top: rem(48px); | ||
} | ||
|
||
// banner styles | ||
.banner { | ||
position: fixed; | ||
top: 0; | ||
z-index: 99999; | ||
display: flex; | ||
width: 100%; | ||
height: rem(48px); | ||
justify-content: space-between; | ||
|
||
background: $blue-70; | ||
color: $text-on-color; | ||
} | ||
|
||
.banner-text { | ||
display: none; | ||
|
||
@include breakpoint('md') { | ||
@include type-style('body-short-01'); | ||
|
||
display: block; | ||
padding: rem(15px) 0 0 $spacing-05; | ||
} | ||
} | ||
|
||
.banner-details { | ||
display: none; | ||
|
||
@include breakpoint('lg') { | ||
display: inline; | ||
padding-left: $spacing-03; | ||
} | ||
} | ||
|
||
// override carbon button styles | ||
.banner :global(.cds--btn--ghost).button-banner { | ||
width: 100%; | ||
max-width: 100%; | ||
color: $text-on-color; | ||
|
||
@include breakpoint('md') { | ||
width: auto; | ||
} | ||
|
||
&:hover { | ||
background: $blue-70-hover; | ||
color: $text-on-color; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Banner from './Banner'; | ||
|
||
export default Banner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a3326c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
carbondesignsystem – ./
carbondesignsystem.vercel.app
carbondesignsystem-carbon-design-system.vercel.app
carbondesignsystem-git-main-carbon-design-system.vercel.app