From 53992ebfb9c5052940ae79ad96fc011e218a80fc Mon Sep 17 00:00:00 2001 From: Gihan Rangana Date: Thu, 2 Jan 2025 10:58:01 +0530 Subject: [PATCH 1/7] dark theme mixin for scss --- snippets/scss/layouts/dark-theme.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 snippets/scss/layouts/dark-theme.md diff --git a/snippets/scss/layouts/dark-theme.md b/snippets/scss/layouts/dark-theme.md new file mode 100644 index 00000000..c4cfd4a0 --- /dev/null +++ b/snippets/scss/layouts/dark-theme.md @@ -0,0 +1,24 @@ +--- +title: Dark Theme +description: SCSS mixin to change styles for dark themes +tags: scss, css, mixin, snippet, dark-theme, layout +author: gihanrangana +--- + +```scss +@mixin isDark($type: 'module') { + $root: &; + + @if $type == 'module' { + :global { + @at-root body[theme='dark'] #{$root} { + @content; + } + } + } @else { + &[theme='dark'] { + @content; + } + } +} +``` \ No newline at end of file From fb75b2836051657e810ce66e08fe1fdfac74f79c Mon Sep 17 00:00:00 2001 From: Gihan Rangana Date: Thu, 2 Jan 2025 11:11:43 +0530 Subject: [PATCH 2/7] added usage --- snippets/scss/layouts/dark-theme.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/snippets/scss/layouts/dark-theme.md b/snippets/scss/layouts/dark-theme.md index c4cfd4a0..49ebe052 100644 --- a/snippets/scss/layouts/dark-theme.md +++ b/snippets/scss/layouts/dark-theme.md @@ -1,6 +1,6 @@ --- title: Dark Theme -description: SCSS mixin to change styles for dark themes +description: SCSS mixin to change styles for dark themes. tags: scss, css, mixin, snippet, dark-theme, layout author: gihanrangana --- @@ -21,4 +21,12 @@ author: gihanrangana } } } + +// Usage: +.container{ + background: #f0f0f0; + @include isDark { + background: #222; + } +} ``` \ No newline at end of file From 826e46fd357d2f6b2840de2489cc1272fe41dd43 Mon Sep 17 00:00:00 2001 From: Gihan Rangana Date: Thu, 2 Jan 2025 11:14:31 +0530 Subject: [PATCH 3/7] fix the consolidate snippet bug --- snippets/scss/layouts/dark-theme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/scss/layouts/dark-theme.md b/snippets/scss/layouts/dark-theme.md index 49ebe052..27eaba17 100644 --- a/snippets/scss/layouts/dark-theme.md +++ b/snippets/scss/layouts/dark-theme.md @@ -1,8 +1,8 @@ --- title: Dark Theme description: SCSS mixin to change styles for dark themes. -tags: scss, css, mixin, snippet, dark-theme, layout author: gihanrangana +tags: scss, css, mixin, snippet, dark-theme, layout --- ```scss From a815b78c0db226d026a36847ab885092c54ec55d Mon Sep 17 00:00:00 2001 From: Gihan Rangana Date: Thu, 2 Jan 2025 12:51:41 +0530 Subject: [PATCH 4/7] update dark theme --- snippets/scss/layouts/dark-theme.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/snippets/scss/layouts/dark-theme.md b/snippets/scss/layouts/dark-theme.md index 27eaba17..4c69818e 100644 --- a/snippets/scss/layouts/dark-theme.md +++ b/snippets/scss/layouts/dark-theme.md @@ -7,19 +7,19 @@ tags: scss, css, mixin, snippet, dark-theme, layout ```scss @mixin isDark($type: 'module') { - $root: &; + $root: &; - @if $type == 'module' { - :global { - @at-root body[theme='dark'] #{$root} { - @content; - } - } - } @else { - &[theme='dark'] { - @content; - } - } + @if $type == 'module' { + :global { + @at-root body[theme='dark'] #{$root} { + @content; + } + } + } @else { + &[theme='dark'] { + @content; + } + } } // Usage: From 455d38ffb207d093c84ac7fbdc7e3d8cf3abb6ae Mon Sep 17 00:00:00 2001 From: Gihan Rangana Date: Thu, 2 Jan 2025 15:50:10 +0530 Subject: [PATCH 5/7] fix CRLF --- snippets/scss/layouts/dark-theme.md | 62 ++++++++++++++--------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/snippets/scss/layouts/dark-theme.md b/snippets/scss/layouts/dark-theme.md index 4c69818e..418776c3 100644 --- a/snippets/scss/layouts/dark-theme.md +++ b/snippets/scss/layouts/dark-theme.md @@ -1,32 +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; - } -} +--- +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; + } +} ``` \ No newline at end of file From 6f3e5453cbb9f3ef9986388258528a046935d24f Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 2 Jan 2025 10:20:30 +0000 Subject: [PATCH 6/7] Update consolidated snippets --- public/consolidated/scss.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/public/consolidated/scss.json b/public/consolidated/scss.json index 28ae8932..498f3665 100644 --- a/public/consolidated/scss.json +++ b/public/consolidated/scss.json @@ -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.", From 5f8995138423207e8b4fc4e514f78f5842ef5dd6 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 2 Jan 2025 10:23:54 +0000 Subject: [PATCH 7/7] Update consolidated snippets --- public/icons/csharp.svg | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 public/icons/csharp.svg diff --git a/public/icons/csharp.svg b/public/icons/csharp.svg new file mode 100644 index 00000000..96cf5abc --- /dev/null +++ b/public/icons/csharp.svg @@ -0,0 +1,10 @@ + + + + + + + + + +