warning or toggle for inline CSS


I really like how easy Bootstrap Studio makes it to create clean HTML and CSS with one exception. It is too easy to add inline CSS when editing Look and Feel. I don't want any inline styles in my code so I wish I could toggle on a warning when this about to happen or even toggle off the Style Attribute option so I don't keep doing this. Otherwise, I have to scan my code and find all the inline styles I added by accident.


But ... if I recall (haven't tried as I usually add my CSS manually to the code window rather than using the dropdown options by having the CSS file already open most of the time)....

Isn't it supposed to remember your last setting per session? I don't believe it will remember between sessions, but each time you open the app I'm pretty sure if you set it to what you want it (by setting a CSS class right away, even if you delete it and only do it to set it), it will then automatically do all CSS classes to whatever file you have chosen.

Granted, as I said, I believe I tried it way in the beginning, but I haven't for over 8 months or more so I could be remembering this wrong. IF someone else can chime in and verify this with the steps to take for him it would help lots I'm sure that are having this same issue and there are lots I'm sure lol.

NOTE to Devs: If it can't be done to allow us to choose a permanent default, can you set the default to auto start with the CSS file instead of inline? That alone would probably stop most of the issues people are having with this. Right now it defaults to inline which most people don't use or want to use so it's not practical. Maybe that would help without getting too deep into editing the setup of how it works now?

Thanks for starting this thread! We decided to default to the Style attribute for three reasons:

  • If it defaults to a stylesheet, the selector of the block where styles are inserted may not have high enough specificity, and the controls will appear as if they're broken (they won't have any effect, as they will be overriden by rules in your CSS).
  • Also if it defaults to a block from your CSS, it is likely it will be the wrong one anyway, so you will have to switch it manually.
  • A stylesheet may not exist at all in the design.

It is difficult to come up with a default that works in every case. The style attribute has the benefit that it is always there and will (almost) always override your CSS and the controls will work.

I see two solutions here:

  • Instead of defaulting to Style the controls are disabled until you create a block. I can imagine that there are people that would hate this.
  • We add some functionality that scans your designs for issues (css in style, images without alt, accessibility checks etc).

I'm looking forward for your thoughts on this.

Thanks for the clarification Martin, I guess that does make sense. How about if each session of BSS prompts you for input for your default location when you first try to create a class using the buttons? This would be only slightly intrusive as it would only be when you first did your first class each session and would reset when the software was closed (or have it remember it too that would be fine). This way it can go to our default set (pretty much as it is now), but with the prompt there wouldn't be any question as to where it was going from the start of each session till the end unless you change it in between yourself. No more inline code accidentally that way? Well at least less lol.

I LOVE the idea of the addition of code scans, on a whole separate entity not connected with this post even, just as a suggestion of it's own! That would help a lot of things that we could do right in the app instead of having to use all the external places which gets daunting after a while too. In my mind, the more I can do in one place the better, and if it's in the software I'm using most of the time, that's the best advantage there is for me. A lot less steps to make to have to get to all the resources is always a good thing! Not as a work around for the issue of this post though, just as an additional feature that we would all find helpful I'm sure.