-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BC] Decide on best way to make improvements to the CSS for core without breaking existing sites #4167
Comments
In another issue, @olafgrabienski said he would like to see:
I assume he is talking about something like CSS injector (Drupal module). But, this got me thinking about whether or not it would be possible to create a "supplemental stylesheet" for Basis that gets added to new site automatically or that existing sites can add at anytime. @klonos - is there an issue for this already? I could not find one (I'll create one if there is any positive feedback to this idea). The idea would be to use this supplemental style sheet to add or override existing CSS in Basis without blindly applying it to existing sites. This had not occurred to me, but now that I think about it, it should be possible. I'm adding it as an option in the original issue description. |
CSS injector is not just a Drupal module: https://backdropcms.org/project/css_injector |
We talked about this briefly today between meetings (discussion did not get recorded) and there seemed to be some interest in option #4. That we could add a supplemental stylesheet that overrides other stylesheets. This stylesheet could be applied to all new sites and old sites to enable it through theme settings. No decision was made, just a short discussion. I'd love more opinions on this. |
@jenlampton - posted this idea in #4166
|
Are you aware of https://github.com/backdrop-contrib/basis_contrib ? You could move development there, then merge changes into core once they're working and approved. |
I have an updated idea similar to #4167 (comment) ... but doesn't involve storing an initial version.
|
WordPress has child themes like we have sub-themes: https://developer.wordpress.org/themes/advanced-topics/child-themes/ |
I'm trying to think of ways to avoid checkboxes and settings and additional CSS files, etc. That all seems overly complicated to me. What about simply informing people that making a sub-theme of a core theme (e.g. Basis) could result in breaking changes on update. If they don't want this, all they need to do is copy the base theme into their This seems like a much simpler option, and uses systems already in-place in Backdrop (theme overrides, etc.). |
Because we don't want to scare anyone away from using Basis as a base theme, and this sounds scary.
This is not a good practice. A copied theme wouldn't get any updates to Basis -- including possible security updates -- when updates come out for core. The whole reason there are base themes (and that we wanted Basis to be better as a base theme) is so that we can avoid this practice. |
Another sort of suggestion we could use: Make an out of box subtheme of Basis called Alternative but very similar: we could rename Note with this approach you'd probably eventually copy almost every CSS file. This is the approach D8 used with their default theming, although the intent for them was mostly around template files, not CSS. I am not sure I would recommend this approach honestly, but it's another option. I don't like the added complexity of everything being a subtheme out of the box. That's too much complexity to introduce at what is usually the most accessible layer of Backdrop for new developers, IMO. |
Isn't it too late to issue such a warning to all the sites that might already be using Basis? I'm not sure if we want to risk breaking sites that were built before such a warning was issued AND the comments raised by @jenlampton. As we work on the "Ready to Wear" initiative, we may find the need to fix some of the CSS bugs/omissions we have in Basis. I'd like see if we can't make some progress on this issue. While, I'm not seeing any consensus on how to proceed, in my opinion, some version of option 4 (see issue summary) seems to be our best bet so far. |
If I'm not mistaken, if a contrib or custom module/theme has the same name as a core one, then the contrib/custom one takes priority. So how about changing our documentation to advise the following when subtheming core-provided themes:
We may also add the following:
Any security risks that come with this decision to use an older, specific version of a core theme should also be communicated. |
@klonos I don't like the recommendation of copying a core theme (or module)
into the contrib location, because people will be very likely not to update
it (even if they wanted to) since we would have no mechanism to remind
them, like we do for core and contrib.
I don't like the suggestion of adding sub-themes in core mainly because
they will show up in the UI and confuse end-users. But it also seems like
we'd only be kicking the can down the road. We'll eventually face the
problem where the sub-theme needs to he changed. To prevent breaking sites
that are using the sub-theme, would we add a sub-sub theme, and then a
sub-sub-sub theme? This also seems like a lot of overhead for what seems to
be only a few lines of css for each change...
…On Fri, Jul 31, 2020, 11:33 PM Gregory Netsas ***@***.***> wrote:
If I'm not mistaken, if a contrib or custom module/theme has the same name
as a core one, then the contrib/custom one takes priority. So how about
changing our documentation
<https://api.backdropcms.org/documentation/creating-sub-themes> to advise
the following when subtheming core-provided themes:
We generally avoid introducing breaking changes to the Basis theme, and
any core theme in general, but there may be situations where we may need
to. In such cases you may then need to tweak any subthemes you have created
to make sure that they still look/work as expected. To avoid this, you have
the following option:
1. Copy the entire /core/themes/basis folder under the root /themes
directory, so that the end folder is /themes/basis.
2. Create your subtheme of Basis as per usual, by specifying base
theme = basis in its .info file.
Since any theme placed under /themes takes priority over any core theme,
your subtheme will always have /themes/basis as its parent instead of
/core/themes/basis. You can now either update your theme at your own pace
(independently of any Backdrop CMS core updates), or never update it at all
if you so choose.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4167 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADBER5X7WSCPN5X5MRLSD3R6OZLTANCNFSM4JFUG4IQ>
.
|
@klonos - Are you just throwing that out there, or do you prefer this solution over something like #-4 (supplemental style sheets)? NOTE: I opened #4512 to start working on a simple PR based upon #-4. I don't know if this is the direction we want to go, but I think that creating a simple PR for this option, might help move this issue forward and better evaluate if it's the best option. I'm hoping to work on this myself, but welcome anyone to get started. |
That would mean that someone who has already sub-themed off of Basis now has a sub-theme of a sub-theme, and a surprise coming. They may not notice the change until something breaks, at which point they have to rebase off of I think a better plan would be to leave New users can pick a full-color theme, advanced users can sub-theme off bland-and-blank, and existing basis-derived themes still work the same, warts and all. Basis may have issues, but they're well known issues. Rearranging things just makes more issues. |
@jlfranklin - Thanks for your ideas. I think your suggestion is very similar to option 2 in the original issue description, but I added it as option 6 (possibly redundant). I have two follow up questions for you?
|
Not if it's done with this problem in mind. I would discourage users from creating sub-themes off a full-color theme, so any future changes there would only affect users of said full-color theme. That should make changes that might break a sub-theme safe to apply here. On the other hand, bland-and-blank needs to be simple and robust, establishing theming structure, nomenclature, and setting reasonable defaults. Future changes should be more conservative: security updates, clearly backwards-compatible bug fixes, and new selectors to support new features in Backdrop. Treat bland-and-blank like any other API, because it is an API. If there is a question, default to applying a change to the full-color themes with comments documenting why it wasn't applied to the parent theme.
That effectively creates two themes, Basis and Basis++. It also creates (and implicitly blesses by the core team) a second sub-theming mechanism: the use of supplemental style sheets. The full-color themes better demonstrate how sub-themes are intended to be done. |
Most themes that you buy from non-drupal/backdrop sources include lots of CSS that people can choose to include or exclude, depending on what they need for their site. It's a good way to provide options.
Many contrib themes already set a variable, then include/exclude a stylesheet based on that variable. I don't see a problem with core adopting a pattern that's been proven successful. I also don't see any parallels between sub-themes and supplemental stylesheets, and I don't think anyone would get them confused. Both are great tools for front-end developers! :) |
I was throwing it for consideration. It's what we are suggesting to digital agencies that work with https://github.com/govCMS/ui-kit-theme / https://github.com/govCMS/govcms8_uikit_starter. Asking customers to optionally copy the theme means less headaches for both parties, but the customer acknowledges that they are opting for less maintenance overhead (which saves them $$$) at the cost of potential security risk. This gives them the freedom to update their themes at their own pace, while we keep the platform/distro updated on their behalf. #SeparationOfResponsibilities++ As stressed earlier, this is not a one-way solution. There's customers that are actively monitoring changes and are updating their subthemes accordingly, and there are others that have a build-and-forget mindset (until the next time they redesign their site). The latter usually prefer to not have their site break with any updates we do to the core/distro. I would like to remind everyone this (emphasis mine): https://backdropcms.org/philosophy
I interpret this as that we'll occasionally need to make breaking changes (which in this case happen every once in 5-6 years, and do not affect every site). In those (rare) cases, I feel that it is fair to consider it the responsibility of site owners to keep up and update their sites (and themes). Although I like #4512 as a solution, it is adding to complexity and overhead for us, when it should have been on site owners. I'm saying this while you all know how passionate I am about BC ❤️ @jenlampton I feel that copying the core theme temporarily whenever there may be a breaking change is not such a bad option for end users. We just need to stress that although possible, it is not the recommended way - the recommended way is to keep up with updates. My point is that it would be nice to have something like #4512; I fully support it - especially since it would help us long-term. Having said that though, it will take a considerable amount of work to support it, it will add complexity/overhead on us. Copying a core theme on the other hand is something that works now, and it's simple for end users to do. If we wanted, we could add a tiny bit of logic to warn that an outdated theme is being used (on the site status report and/or the "Available updates" page), as a reminder that they need to update as soon as possible. |
I was under the impression that if you use the same names for .css files, they completely override things in the order of core -> contrib/custom + base theme -> subtheme. Right? |
Yes, that's true. But most theme's don't override core stylesheets with their own copies that also have the same name. Most themes have their own Putting CSS changes only into a starterkit theme could be a solution for us, but it would mean those changes are only opt-in, and would only affect new installs if they chose to create a custom theme, and if that custom theme started with the starterkit. No bugfixes for Basis :( |
Yeah, I didn't say that a starter theme is THE solution for us - just A possible solution. It does have its downsides, but:
It just means that there will need to be a mentality shift: instead of subtheming the default theme that ships with core, the recommended workflow would be to use a command-line tool or a UI equivalent, to generate a new theme, off of the starter theme. The resulting theme is a "stand-alone" theme instead of a subtheme. I am not advocating for this, nor saying it is a good fit for Backdrop - just mentioning it in the spirit of considering all options. |
This should really be "a tiny percentage of new sites get..." but It is an interesting idea. My preference would be to stick with one of these other solutions that solves all our problems and doesn't increase the complexity. I prefer having a real, usable theme (Basis) as our starterkit, but I know the community loves starterkits, so I'm curious to see how everyone would feel about this by 2.x. |
D9 now ships with a starterkit theme generator See: https://www.drupal.org/node/3206389
|
At the last Backdrop LIVE we had a full session on the topic of adding a new theme to core (#5175). I created this issue at least in part, because of my own perception that this issue has reached a logjam and a lack of any sense that it is likely to move foward in the near future. I was a little surprised to hear that @jenlampton thinks we are much closer to a solution than I thought. I'm looking forward to hearing more about that solution. |
The discussion in my mind all revolves around "what is the end result". If it is a major change in backend structure then the "fix" should not be applied to the existing theme and instead treated as a feature request on a new theme because this type of change may affect the output of an existing site. If it's minor UI tweaks or fixes, it should be applied to the existing theme and pushed through normal releases. It all comes down to what the fix or change actually is. Not every CSS tweak will cause a meltdown for the user but other CSS tweaks might lead to unforeseen catastrophic results. What we need is a policy created around: "what constitutes a major change vs a minor change in a theme". I don't know what the criteria would be off hand, but if an issues goes through a certain set of checks one way or the other, it determines where the issue lies: Existing theme or Future theme. Since there doesn't appear to be a formal policy around this topic, we're stuck here trying to figure out whether updates should be applied or not applied. Draw a line in the sand and specify exactly what the approach is. Like @stpaultim stated, Basis has problems and we can't figure out if we fix them or not because there's no guidelines to help determine whether the fix is safe or needs to be addressed in a future theme. Ideally, once a theme is promoted as "stable" and put into core, a new theme repo should immediately be created where all "breaking" requests/issues are sent. For example, converting to using CSS Grid VS whatever is used in the old theme. There are certainly a lot of suggestions around this, some more complex than others but at the end of the day, the end result of what is being accomplished is what should determine whether an update is pushed to the stable theme or the future theme and we need a set of guidelines that help point in the right direction. |
I'm making this a feature request, so that I can vote on it in our feature survey. My colleagues and I were just working on a CSS issue for Bartik, but I'm really not sure that we can safely merge it, given this concern. There are quite a few outstanding CSS issues that I am avoiding until this is resolved. Just a reminder, that we have several viable solutions to solving this problem. What we lack is consensus on any one solution. It may be time to escalate this issue to the PMC. |
Putting this on the agenda for the next Backdrop LIVE to see if we can break the log jam. |
It's too late to get this going for 1.29. But, solving this before 1.30 would be nice. |
We seem to have settled on this solution: |
I think we can close this finally, now that #4782 is merged. |
@herbdool THANK YOU! I'm very happy to see this issue go away! |
UPDATED: August 27, 2020 by @stpaultim
Possible solutions:
Description of the need
A new user that does not have the time or skills to create their own theme or sub-theme should be able to build a solid, reliable, and functional site without need to install a contrib theme. However, there are a number of small problems with Basis that make that difficult, some of which have been fixed or are in the process of being fixed.
Most Backdrop developers are used to creating custom themes for sub-themes for their sites and routinely deal with these issues during that process OR have created their own sub-theme templates with fixes in place.
It is my concern that as we continue to tweak Basis and/or fix bugs, that we might end up breaking or making unexpected changes to existing sites that are using Basis as their only theme. Since we are at least 3 years away from Backdrop CMS v 2.x, I would like to decide on a best course of action for providing a robust and flexible theme (for beginners with limited theme building skills) in core that can safely be used "out of the box" and will accommodate a variety of uses.
Possible solutions that have been considered
off
, but on new sites it the install profiler would turn iton
. [Added 10/28/19 - inspired by discussion here: Should we set default margins on 'p' tag in Basis? #4166]Some Issues blocked by this decision
Additional information
This idea was inspired by issues such as:
[META] Issues with Basis
#4094
Should we set default margins on 'p' tag in Basis?
#4166
Remove the hover color from header account links in Basis
#3748
Basis & Flexible Layout Templates: Remove white space between two hero blocks placed next to each other.
#4095
I really don't know if this is a good idea or if it's necessary to accomplish the goals I've outlined, but I wanted to put it out there for discussion.
The text was updated successfully, but these errors were encountered: