Comments (7)
Update:
This block is the closest I've gotten:
@function Quotify($variable) {
@return #{"\""#{$variable}"\""};
}
@mixin theme() {
@each $theme, $map in $themes {
@if $theme == "default" {
:root {
@each $key, $value in $map {
#{--#{$key}}: $value;
}
}
}
@else {
$Quoted: Quotify($theme);
[data-theme=#{$Quoted}] {
@each $key, $value in $map {
#{--#{$key}}: $value;
}
}
}
}
}
@include theme();
Which gets: [data-theme=" dark "]
from webcompiler.
Can you give this a try and let me know if it works as expected?
https://sass-lang.com/documentation/values/strings
from webcompiler.
That was the first place I'd looked - using the quote function instead of that custom one resulted in data-theme=""dark""
Initially, I'd thought it was just my mistake, so I had made this question on SO
from webcompiler.
Are the quotes here required? This could be related to this issue.
from webcompiler.
Ahh, looking into it based on that feedback; it looks like it's optional (so long as the value is alphanumeric). So, it's probably worth looking into, just incase someone needs it for a href tag at some point.
from webcompiler.
The string.quote($variable) syntax appears to work as expected outside of the attribute selector, if you have an example where the quotes are required, but you can't get them to stay, I'd be happy to file a bug with Dart Sass and upgrade the extension when they address it.
from webcompiler.
I'm gonna close this issue since I haven't found any places where it removed the quotes when they are required.
from webcompiler.
Related Issues (20)
- Problem with compiling HOT 18
- VS Gallery link pointing at old version HOT 2
- Context menus not displaying HOT 2
- Resulting CSS file only contains comments from @use dependencies HOT 1
- Feature: Group media queries HOT 1
- Issue compiling partial .scss files in folders HOT 1
- Extention is not correct working with @container instead @media
- Not working on Visual Studio Mac HOT 4
- Validation warning shown for valid css, how to turn this off ? HOT 1
- sass.cmd is not recognized as an internal or external command HOT 5
- Sourcemap in css has an absolute path HOT 1
- node-sass is now deprecated HOT 3
- Question: Looking for guidance using compiler/bundler with Razor Class Library (RCL) projects HOT 1
- Cannot compile SCSS with symlink'd or shorcut'd references HOT 1
- SCSS unit tests failing due to error in node package
- Can you add custom options parameter to SASS
- Don't get Web Compiler option on context menu. Is the extension limited to certain kinds of VS projects? HOT 5
- .min.js instead of .es5.js HOT 3
- Version 1.14.11 on Nuget HOT 2
- VS2022 Keeps Crashing HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webcompiler.