- This topic has 6 replies, 2 voices, and was last updated 5 years, 10 months ago by
Sebastian.
Author | Posts |
---|---|
Sridhar
June 3, 2019 at 9:42 am
|
Heads up! this post was created when Microthemer was at version 5. The current version is 7. Some references to the interface may be out of date. I have hand coded a bunch of CSS in MT and see that it has added
for every style block. Screenshot: https://d.pr/i/dvT9w3 It’s not doing this for the selector that I added via the MT’s interface, only the ones I typed inside the left side code area. May I know what this is for and if there’s a way to get rid of it? |
Sebastian
June 3, 2019 at 8:41 pm
|
Hey Sridhar, So the little MT [ sub: 1 ] comments tell Microthemer that the extra CSS selectors you add belong to one MT UI selector, which you have named Everest form. MT allows multiple CSS selectors, but only the first selector syncs up with the UI fields, in that you can edit the CSS interchangeably via the editor or the fields. And the responsive tabs only auto-fill the first selector. So really, it is probably best to create a single UI selector for a single CSS selector – most of the time at least. I could set the MT [ sub: 1 ] comment to be hidden (and just use it for internal purposes in the background). But when the UI CSS is also interchangeable with the full code CSS editor, the comment will need to be present in order to map the CSS to the UI consistently. As I mentioned in my reply earlier, this feature isn’t far off. And I felt it might be more consistent to always show the MT [ sub: 1 ] comment. I could be swayed though… You will notice that MT also adds comments for Google fonts and animation events to ensure the raw CSS can be mapped back to the UI fields correctly. This pattern is necessary for interchangeability as far as I can tell. I’m listening if you have strong feeling from a user perspective though. Cheers, |
Sridhar
June 3, 2019 at 11:05 pm
|
Got it. Is there a way to strip these in the generated CSS (View > Generated CSS & JS)? |
Sebastian
June 4, 2019 at 4:37 pm
|
Not currently. In order to support that I would need to add an option to the preferences. This would need to be configurable because stripping the comments would come at the cost of being able to important the CSS file back to Microthemer without changing the structure of the selectors in the UI. Do you want to strip these comments because it feels generally cleaner? Or some other reason? Either way, I am happy to add the configuration option if it is important to you. Cheers, |
Sebastian
June 4, 2019 at 4:41 pm
|
Oh and you can strip all comments if you choose the minify CSS option. But of course minifying isn’t good if you may wish the edit the CSS code again outside of Microthemer. |
Sridhar
June 4, 2019 at 11:19 pm
|
There are online tools that I can use to unminify CSS. I think this can also be done using Chrome dev tools. So let’s leave this as is for now. |
Sebastian
June 5, 2019 at 8:45 am
|
OK cool. |