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

Scss dark theme #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Mathys-Gasnier merged 8 commits into quicksnip-dev:main from gihanrangana:scss-dark-theme
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions public/consolidated/scss.json
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,21 @@
"contributors": [],
"code": "@mixin aspect-ratio($width, $height) {\n position: relative;\n width: 100%;\n padding-top: ($height / $width) * 100%;\n > * {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n}\n"
},
{
"title": "Dark Theme",
"description": "SCSS mixin to change styles for dark themes.",
"author": "gihanrangana",
"tags": [
"scss",
"css",
"mixin",
"snippet",
"dark-theme",
"layout"
],
"contributors": [],
"code": "@mixin isDark($type: 'module') {\n $root: &;\n\n @if $type == 'module' {\n :global {\n @at-root body[theme='dark'] #{$root} {\n @content;\n }\n }\n } @else {\n &[theme='dark'] {\n @content;\n }\n }\n}\n\n// Usage:\n.container{\n\tbackground: #f0f0f0;\n\t@include isDark {\n\t\tbackground: #222;\n\t}\n}\n"
},
{
"title": "Flex Center",
"description": "A mixin to center content using flexbox.",
Expand Down
10 changes: 10 additions & 0 deletions public/icons/csharp.svg
View file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[フレーム]
32 changes: 32 additions & 0 deletions snippets/scss/layouts/dark-theme.md
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: Dark Theme
description: SCSS mixin to change styles for dark themes.
author: gihanrangana
tags: scss, css, mixin, snippet, dark-theme, layout
---

```scss
@mixin isDark($type: 'module') {
$root: &;

@if $type == 'module' {
:global {
@at-root body[theme='dark'] #{$root} {
@content;
}
}
} @else {
&[theme='dark'] {
@content;
}
}
}

// Usage:
.container{
background: #f0f0f0;
@include isDark {
background: #222;
}
}
```

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /