Closed Mara-Li closed 4 years ago
Ah, it's no problem; happy to help~
So there's two things you can do. You can edit the theme file in your themes folder (which in your case is ursine-polar.css
), but that can be a bit tedious because you'd have to remove all the current "CodeMirror" style rules that's mixed in there or overwrite them which can cause some side effects. (Though if you only want to change a color or two from the current theme, then this and a bit of trail & error can do the trick)
The other thing you can do is clone this repo, make your changes (as I'll describe below), & build your personalized CSS files as described here. You can then drop those built files in your theme folder. This is more intuitive, but you'll need to have npm
installed beforehand.
If you go the second way, you can just edit ursine/_code-3024-day.scss
to your liking. You could also make a new SCSS file and import from there instead. The new file just needs to be a partial file (in other words, the file name must start with a "_"), & you'd need to change the import statement here:
https://github.com/aCluelessDanny/typora-theme-ursine/blob/e1e5ddd0464f067995ba84f1cc8d863da1e6ffdf/ursine-polar.scss#L59
If you know what you're doing, you can finetune the colors to your tastes on your own. But just in case, you can also grab a theme from CodeMirror and just copy-paste it into the theme. Here's a theme tester they have on their site, and once you find one you like, you can grab it from here.
Thanks you verymuch ! The second solution seems to be a little easy :) I will try that !
Okay, well, I choose two thème for polar/dark theme, but where i must paste it on the theme ? In the .css polar ?
Alright, so you just have to replace the current "CodeMirror" theme with the one you selected. Ursine Polar uses ursine/_code-3024-day.scss
, while Umbra uses ursine/_dracula.scss
. So basically, copy-paste to replace all of its contents. It'd look something like this:
And there's also that route of making a new file like I described in the past comment, in case you don't want to remove the current theme for any other reason.
After that, just build your files and your new CSS files will be in the /dist
directory
Well, I success to change my theme, but in dark and light, i have the same theme, and I don't understand why ? Dracula have the "yonce" theme pasted, and 3024, the Yeti theme. But, i seem that Umbra use the yeti ?
Moreover, after I want change the theme, it doesn't change :<. I do "npm i" and "gulp dev" and i have that :
Moreover, it doesn't change anything if I try just "gulp". I don't understand :<
Huh, that's interesting...
Okay so I tried it myself, & I actually forgot about one step that you have to do with the file before building. After you paste the file, you'll need to replace the common class name it has to cm-s-inner
. So for example, with the "yonce" theme, you'll want to replace every .cm-s-yonce
with .cm-s-inner
.
Gulp on the other hand is doing its job, though I think you misinterpret how it works. When you run just gulp
, the CSS files aren't placed directly in your themes folder, so you have to manually place them from the ./dist
directory to your themes folder.
gulp dev
on the other hand is a neat thing that does it for you every time you save. So the output in that screenshot is actually normal.
Now with that said, I'm noticing a side effect that's more on my side, which I have to fix. Turns out the way I import Polar's code theme kinda messes up depending on the combination of themes used (yonce and yeti happens to be one of them). You can still go ahead and try it while I fix it, but you might find a couple of hiccups with it.
Oh okay ! Thanks to help to you found a bug anyway ^^
Hello ! I'm new here, and I dislike the color used for some command in bash, the light green one (like echo, mv...). How can I change it ?
Sorry for the noob question :<