sololearn , css variables | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

sololearn , css variables

i recently found that solo learn don't support css variable ...or is their any other way https://code.sololearn.com/WV2XCbhiVisz/?ref=app

23rd Jun 2019, 3:26 AM
anjit pariyar
anjit pariyar - avatar
10 Answers
+ 6
There is something that acts like a variable when using :root{} class I use it when I have multiple properites that have the same value :root{ //store the colour red in cRed --cRed:red; } //using the cRed variable background-color:var(--cRed);
23rd Jun 2019, 7:33 AM
D_Stark
D_Stark - avatar
+ 3
Please show your code here so that we can help you https://www.sololearn.com/post/75089/?ref=app
23rd Jun 2019, 3:36 AM
Gordon
Gordon - avatar
+ 3
anjit pariyar Support for CSS variables will likely be a factor of one's device than anything to do with the app itself.
23rd Jun 2019, 7:46 AM
David Carroll
David Carroll - avatar
+ 2
Gordon i posted my code..ignore other part rather than css variable...you can focus on card-header part
23rd Jun 2019, 8:00 AM
anjit pariyar
anjit pariyar - avatar
+ 2
please refer https://anjitzero.github.io/remainder/ almost same code
23rd Jun 2019, 8:05 AM
anjit pariyar
anjit pariyar - avatar
+ 2
The CSS variables of your code works fine on my device, can you use this code to check your browser stats, and post the stats here? https://code.sololearn.com/W4vC0w43yqNQ/?ref=app
23rd Jun 2019, 11:51 AM
Gordon
Gordon - avatar
+ 2
name : Android Browser version : 4.0 layout : Blink os : Android 6.0 description : Android Browser 4.0 (like Chrome 46.0.2490.76) on Android 6.0
23rd Jun 2019, 12:47 PM
anjit pariyar
anjit pariyar - avatar
+ 2
knowing that it works on your device , i now realize what mod David Carroll was talking about
23rd Jun 2019, 12:48 PM
anjit pariyar
anjit pariyar - avatar
+ 2
Yes, CSS Variable is available for Chrome 49 onwards ref: Mozilla Doc https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties#Browser_compatibility SoloLearn runs web code with browser of own device. Hence the browser version of your device matters. Your code is correct though. You can run it on websites such as codepen or repl.it
23rd Jun 2019, 3:13 PM
Gordon
Gordon - avatar
+ 1
anjit pariyar update webview
24th Jun 2019, 12:07 AM
Calviղ
Calviղ - avatar