Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 53992eb

Browse files
dark theme mixin for scss
1 parent f1f3b6a commit 53992eb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎snippets/scss/layouts/dark-theme.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: Dark Theme
3+
description: SCSS mixin to change styles for dark themes
4+
tags: scss, css, mixin, snippet, dark-theme, layout
5+
author: gihanrangana
6+
---
7+
8+
```scss
9+
@mixin isDark($type: 'module') {
10+
$root: &;
11+
12+
@if $type == 'module' {
13+
:global {
14+
@at-root body[theme='dark'] #{$root} {
15+
@content;
16+
}
17+
}
18+
} @else {
19+
&[theme='dark'] {
20+
@content;
21+
}
22+
}
23+
}
24+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /