civicrm / org.civicrm.shoreditch

Other
45 stars 59 forks source link

is is possible to leave bootstrap to the theme? #3

Open tttp opened 7 years ago

tttp commented 7 years ago

Hi, For what I understand, this extension bundles both

As most of our themes are already including bootstrap, is there a way to only include the later?

totten commented 7 years ago

tldr

You can probably use other Bootstrap-compliant extensions (such as Mosaico 2.x) without Shoreditch, but there are follow-up questions in this scenario, like:

  1. How does one customize civicrm.css with other themes?
  2. How does one load the JS files with other themes?

(Extra Thought) In the long-term, some community-of-practice/guidance for CMS themes seems inevitable. However, that will by its nature be a nuanced/exacting problem-space. The aim in publishing Shoreditch as a Civi extension is to provide a good baseline that works with new+old Civi screens across several environments so that a typical implementer doesn't need to master the topic.

General Architecture

I've found it helpful to talk about theming along these lines:

If you're a designer/integrator/customizer who wants to change the overall look-and-feel, then your aim is to provide is a pair of CSS files:

If you're trying to implement your own look-and-feel, you can use the Styleguide. It provides some reference material on the vocabularies, and it provides a smoketest (for a general visual of how well your CSS works with conformant HTML).

Additional notes, caveats, monkey-wrenches

totten commented 7 years ago

Another good person to comment on this is @AkA84.

xurizaemon commented 7 years ago

Thanks Tim, that's really helpful. Hope to follow this up with informed feedback once we've given it a spin.

gah242s commented 7 years ago

Is Backbone.js a current monkey-wrench or does this allow for side-stepping the issue? Or does it not even play into this scenario? (https://issues.civicrm.org/jira/browse/CRM-17352) Selfishly, I'm hoping it's a monkey wrench because of the large-ish amount of WordPress theme/plugin problems.

totten commented 7 years ago

IMHO, Backbone.js should be treated as orthogonal to CSS. (Technically speaking, any permutation of {BackboneJS,AngularJS,EmberJS} x {BootstrapCSS,crm-*} is conceivable -- although obviously one might go insane if they actually worked with every permutation continuously.)

CRM-17352 sounds like a legit-but-separate issue.

nganivet commented 7 years ago

Tim - great write-up, this ought to be transferred to an 'architecture' chapter in the developer documentation so we all work from the same notions/vocabulary.

jeffcapeshop commented 7 years ago

Hi - I wanted to try this out but i have to confess to being a little confused as to how to get it working - if it applies only with id="bootstrap-theme", what creates that markup? is there a specific/default theme? Thanks!

AkA84 commented 7 years ago

@jeffcapeshop well the bootstrap theme is supposed to be used in new pages, so when you create a new page (for example of an extension that you are writing) you will write the markup contained in an element with [id="bootstrap-theme"] and the theme will be applied automatically


<!-- my-extension-template.html -->
<div id="bootstrap-theme">
  <!-- here goes your extension's bootstrap-compliant markup -->
</div>
jeffcapeshop commented 7 years ago

@AkA84 and what about the core theme? if i use custom-civicrm.css option, it only matches visually if i use the Seven admin theme, not bootstrap. What is the expected setup to use this with core?

Thanks

AkA84 commented 7 years ago

@jeffcapeshop

if i use custom-civicrm.css option, it only matches visually if i use the Seven admin theme, not bootstrap

Can you show me with a couple of screenshots what you mean?

Currently we are testing the theme only with Seven, not with other themes

sleewok commented 6 years ago

Can you PLEASE add information in the readme about setting the Drupal theme to Seven? That seems like a pretty important detail to be missing...