File tree 5 files changed +72
-1
lines changed
docusaurus-theme-classic/src
5 files changed +72
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,12 @@ let { ThemeConfigSchema } = require(path.resolve(
10
10
'../../node_modules/@docusaurus/theme-classic/lib/validateThemeConfig.js'
11
11
) ) ;
12
12
13
+ const NavbarCtaSchema = Joi . object ( {
14
+ type : Joi . string ( ) . equal ( 'cta' ) . required ( ) ,
15
+ position : Joi . string ( ) . default ( 'left' ) ,
16
+ text : Joi . string ( ) . required ( ) ,
17
+ href : Joi . string ( ) . required ( ) ,
18
+ } ) ;
13
19
const NavbarIconLinkSchema = Joi . object ( {
14
20
type : Joi . string ( ) . equal ( 'iconLink' ) . required ( ) ,
15
21
position : Joi . string ( ) . default ( 'left' ) ,
@@ -29,7 +35,7 @@ const NavbarSeparatorSchema = Joi.object({
29
35
30
36
ThemeConfigSchema = ThemeConfigSchema . concat (
31
37
Joi . object ( {
32
- navbar : { items : Joi . array ( ) . items ( NavbarIconLinkSchema ) . items ( NavbarSeparatorSchema ) } ,
38
+ navbar : { items : Joi . array ( ) . items ( NavbarIconLinkSchema ) . items ( NavbarSeparatorSchema ) . items ( NavbarCtaSchema ) } ,
33
39
} )
34
40
) ;
35
41
Original file line number Diff line number Diff line change @@ -61,6 +61,12 @@ module.exports = {
61
61
label : 'Native' ,
62
62
position : 'left' ,
63
63
} ,
64
+ {
65
+ type : 'cta' ,
66
+ position : 'left' ,
67
+ text : 'Ionic v6.0.0 Upgrade Guide' ,
68
+ href : `${ BASE_URL } /intro/upgrading-to-ionic-6` ,
69
+ } ,
64
70
{
65
71
type : 'docsVersionDropdown' ,
66
72
position : 'right' ,
Original file line number Diff line number Diff line change @@ -51,6 +51,42 @@ html[data-theme='dark'] {
51
51
}
52
52
}
53
53
}
54
+
55
+ .cta {
56
+ display : flex ;
57
+ align-items : center ;
58
+
59
+ padding : 0.375rem 0.625rem ;
60
+
61
+ background : linear-gradient (90deg , #495fff 0% , #18c6ff 114.68% );
62
+
63
+ color : #fff ;
64
+
65
+ border-radius : 200px ;
66
+
67
+ white-space : nowrap ;
68
+
69
+ font-weight : 600 ;
70
+ font-size : 0.75rem ;
71
+ line-height : 100% ;
72
+
73
+ transition : opacity 0.2s ease-out ;
74
+
75
+ margin-inline-start : 0.5rem ;
76
+
77
+ @media (max-width : 1400px ) {
78
+ display : none ;
79
+ }
80
+
81
+ & :hover ,
82
+ & :active {
83
+ opacity : 0.8 ;
84
+ }
85
+
86
+ svg {
87
+ margin-inline-start : 0.125rem ;
88
+ }
89
+ }
54
90
}
55
91
56
92
& __items--right {
Original file line number Diff line number Diff line change
1
+ import clsx from 'clsx' ;
2
+ import React from 'react' ;
3
+
4
+ export default function NavbarCta ( { text, ...props } ) {
5
+ return (
6
+ < a { ...props } className = { clsx ( props . className , 'cta' ) } >
7
+ { text }
8
+ < svg xmlns = "http://www.w3.org/2000/svg" class = "ionicon" viewBox = "0 0 512 512" width = "12" height = "12" >
9
+ < title > Arrow Forward</ title >
10
+ < path
11
+ fill = "none"
12
+ stroke = "currentColor"
13
+ stroke-linecap = "round"
14
+ stroke-linejoin = "round"
15
+ stroke-width = "48"
16
+ d = "M268 112l144 144-144 144M392 256H100"
17
+ />
18
+ </ svg >
19
+ </ a >
20
+ ) ;
21
+ }
Original file line number Diff line number Diff line change @@ -2,10 +2,12 @@ import OriginalNavbarItem from '@theme-original/NavbarItem';
2
2
import React from 'react' ;
3
3
import NavbarIconLink from '@theme/NavbarItem/NavbarIconLink' ;
4
4
import NavbarSeparator from '@theme/NavbarItem/NavbarSeparator' ;
5
+ import NavbarCta from '@theme/NavbarItem/NavbarCta' ;
5
6
6
7
const CustomNavbarItemComponents = {
7
8
iconLink : ( ) => NavbarIconLink ,
8
9
separator : ( ) => NavbarSeparator ,
10
+ cta : ( ) => NavbarCta ,
9
11
} as const ;
10
12
11
13
export default function NavbarItem ( { type, ...props } ) {
You can’t perform that action at this time.
0 commit comments