The module produce wrong weights of CSS files.

  • The error exist only if the module enabled.
  • If the module not enabled, the correct CSS file weights are used from the JQM theme with their defined weights. BUT, not the two weights of the Next thing below.

The result:

The theme CSS file is not the last CSS file!

Thus it is not possible to overwrite formattings in

  1. "jquery.mobile-1.0.1.css"
  2. "jquery.mobile.structure-1.0.1.css"

with the theme CSS file or subtheme CSS file.

Next thing

The next thing is the wrong weight of the JQM files 1. and 2..

I think, the jquery.mobile.structure CSS file extend the jquery.mobile CSS file.

To follow this, the jquery.mobile.structure CSS file MUST be linked AFTER the jquery.mobile CSS file!

Solution

Proper weights of CSS files:

  1. jquery.mobile CSS file
  2. jquery.mobile.structure CSS file
  3. jQuery Mobile theme CSS file

This is very important to fix this bug to allow the good use of JQM subthemes.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

adamjanzen’s picture

Using the jquery mobile themeroller, it also suggests putting the structure CSS after the theme file:

<link rel="stylesheet" href="themes/TestTheme.min.css" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile.structure-1.1.0.min.css" />

Probably need to look further into why this is done by default.

jasonsavino’s picture

I believe that in both the module and the theme there should be an option to use the default jquerymobile css files or the structure plus custom css files. There is no need to use the structure css file when using the default css. so the end result would be:

DEFAULT:

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>

CUSTOM:

  <link rel="stylesheet" href="sites/all/THEME/css/my-custom-theme.css" />
  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile.structure-1.1.0.min.css" /> 
  <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> 
  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
minorOffense’s picture

This means we'll probably have to register the weight of the default structure css file to allow other modules/themes to position themselves above it.

quiptime’s picture

@Jason,

the CSS file weights in #2 are wrong!

Thats is correct:

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile.structure-1.1.0.min.css" />
<link rel="stylesheet" href="sites/all/THEME/css/my-custom-theme.css" />

 

The ultimate authority must always be the CSS file of the theme.

This is a golden rule of Drupals theming.

jasonsavino’s picture

Status: Active » Needs review
FileSize
50.92 KB
50.52 KB

The structure file is not to be used with the default swatches. It is to be used in such cases as a theme created with themeroller. I agree that the placement of the Drupal theme css file was incorrect but that was by design. Placing it there allowed the swatches to be overridden at the correct time.

After careful thought, I decided to split the styles into 2 files in the mobile_jquery theme and will move similar functionality to the module shortly.
Also, new theme settings have been introduced and can be seen in the attached images.

If the structure file is disabled the following code is added:

<link type="text/css" rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" media="all" />
<link type="text/css" rel="stylesheet" href="/sites/all/themes/mobile_jquery/styles/mobile_jquery.css" media="all" />

If the structure file is enabled the following code is added:

<link type="text/css" rel="stylesheet" href="/sites/all/themes/mobile_jquery/styles/jquery.mobile.overrides.css" media="all" />
<link type="text/css" rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile.structure-1.0.1.min.css" media="all" />
<link type="text/css" rel="stylesheet" href="/sites/all/themes/mobile_jquery/styles/mobile_jquery.css" media="all" />
minorOffense’s picture

Have these changes been applied? If so, we can do some testing so we can close the issue.

cimo75’s picture

+1 also for me the library css file is loaded last so I can t load any swatch

kscheirer’s picture

Version: 7.x-2.0-beta1 » 7.x-2.x-dev
Priority: Major » Critical
Status: Needs review » Needs work

Looks like this is still a problem. I'm not sure what needs to be changed, can someone get me started on a patch?