Skip to content

Commit 9d74c9c

Browse files
committed
refactor: migrate to Sass modules
1 parent e53f0fe commit 9d74c9c

16 files changed

+116
-65
lines changed

packages/docs/gatsby-browser.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import '@docsearch/css'
33
import DefaultLayout from './src/templates/DefaultLayout'
44
import DocsLayout from './src/templates/DocsLayout'
55
import './src/styles/styles.scss'
6+
import './src/styles/search.scss'
67

78
export const wrapRootElement = ({ element }: { element: ReactNode }) => {
89
return <DefaultLayout>{element}</DefaultLayout>

packages/docs/gatsby-ssr.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import '@docsearch/css'
33
import DefaultLayout from './src/templates/DefaultLayout'
44
import DocsLayout from './src/templates/DocsLayout'
55
import './src/styles/styles.scss'
6+
import './src/styles/search.scss'
67

78
export const wrapRootElement = ({ element }: { element: ReactNode }) => {
89
return <DefaultLayout>{element}</DefaultLayout>

packages/docs/src/styles/_ads.scss

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
// stylelint-disable declaration-no-important, selector-max-id
2+
@use "@coreui/coreui/scss/mixins/border-radius" as *;
3+
@use "@coreui/coreui/scss/mixins/breakpoints" as *;
4+
@use "@coreui/coreui/scss/vendor/rfs" as *;
25

36
//
47
// Carbon ads
58
//
69

7-
.carbonads-wrapper {
8-
min-height: 130px;
9-
margin: 2rem 0;
10-
}
11-
1210
#carbonads {
1311
position: static;
1412
display: block;
1513
max-width: 400px;
1614
padding: 15px 15px 15px 160px;
15+
margin: 2rem 0;
1716
overflow: hidden;
1817
@include font-size(.8125rem);
1918
line-height: 1.4;

packages/docs/src/styles/_anchor.scss

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1+
@use "@coreui/coreui/scss/mixins/transition" as *;
2+
@use "@coreui/coreui/scss/variables" as *;
13

24
.anchor-link {
5+
padding: 0 .175rem;
36
font-weight: 400;
47
color: rgba($link-color, .5);
5-
padding-left: 0.375em;
68
text-decoration: none;
79
opacity: 0;
8-
@include transition(opacity 0.1s ease-in-out, color .15s ease-in-out);
10+
@include transition(color .15s ease-in-out, opacity .15s ease-in-out);
11+
12+
&::after {
13+
content: "#";
14+
}
915

1016
&:focus,
11-
&:hover {
17+
&:hover,
18+
:hover > &,
19+
:target > & {
1220
color: $link-color;
1321
text-decoration: none;
22+
opacity: 1;
1423
}
1524
}
16-
17-
h2, h3, h4, h5, h6, td {
18-
&:hover {
19-
.anchor-link {
20-
opacity: 1;
21-
}
22-
}
23-
}

packages/docs/src/styles/_callouts.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "@coreui/coreui/scss/variables" as *;
2+
@use "variables" as *;
3+
14
//
25
// Callouts
36
//

packages/docs/src/styles/_component-examples.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
@use "@coreui/coreui/scss/mixins/border-radius" as *;
2+
@use "@coreui/coreui/scss/mixins/breakpoints" as *;
3+
@use "@coreui/coreui/scss/mixins/clearfix" as *;
4+
@use "@coreui/coreui/scss/mixins/container" as *;
5+
@use "@coreui/coreui/scss/mixins/grid" as *;
6+
@use "@coreui/coreui/scss/vendor/rfs" as *;
7+
@use "@coreui/coreui/scss/variables" as *;
8+
@use "variables" as *;
9+
110
//
211
// Docs examples
312
//

packages/docs/src/styles/_component-sub-nav.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "@coreui/coreui/scss/mixins/transition" as *;
2+
13
.component-sub-nav-wrapper {
24
@include transition(box-shadow 0.2s linear);
35
&:before {

packages/docs/src/styles/_footer.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "@coreui/coreui/scss/vendor/rfs" as *;
2+
@use "@coreui/coreui/scss/variables" as *;
3+
14
//
25
// Footer
36
//

packages/docs/src/styles/_layout.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
@use "@coreui/coreui/scss/mixins/breakpoints" as *;
2+
@use "@coreui/coreui/scss/mixins/transition" as *;
3+
@use "@coreui/coreui/scss/variables" as *;
4+
15
.wrapper {
26
width: 100%;
3-
@include ltr-rtl("padding-left", var(--cui-sidebar-occupy-start, 0));
7+
padding-inline-start: var(--cui-sidebar-occupy-start, 0);
48
will-change: auto;
59
@include transition(padding .15s);
610
}

packages/docs/src/styles/_prism.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@use "sass:color";
2+
@use "@coreui/coreui/scss/mixins/color-mode" as *;
3+
@use "@coreui/coreui/scss/variables" as *;
4+
15
/* PrismJS 1.24.1
26
https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+clike+javascript */
37
/**
@@ -16,7 +20,7 @@ https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+cli
1620
--base05: #333;
1721
--base06: #fff;
1822
--base07: #{$teal-700}; // #9a6700
19-
--base08: #{mix($red-500, $red-600, 50%)}; // #bc4c00
23+
--base08: #{color.mix($red-500, $red-600, 50%)}; // #bc4c00
2024
--base09: #{$cyan-700}; // #087990
2125
--base0A: #{$purple-500}; // #795da3
2226
--base0B: #{$blue-700}; // #183691

0 commit comments

Comments
 (0)