Adobe
Productos
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Más productos
Soluciones
Marketing digital
Medios digitales
Educación
Servicios financieros
Administración
Gestión de experiencias web
Más soluciones
Formación Ayuda Descargas Empresa
Comprar
Uso doméstico Para uso personal y autónomos
Educación Para estudiantes, profesores y empleados
Empresas para pequeñas y medianas empresas
Programas multilicencia para empresas, centros educativos y gobiernos
Otras formas de comprar
Ofertas especiales
Búsqueda
 
Información Registro
Bienvenido, Mi carro Mis envíos Asistencia
Mi cuenta
Salir
¿Por qué registrarse? Regístrese para poder gestionar su cuenta y acceder a descargas de prueba, ampliaciones de productos, diferentes áreas de la comunidad y mucho más.
Adobe
Productos Secciones Comprar   Búsqueda  
Soluciones Empresa
Ayuda Aprendizaje
Registro Salir Mis envíos Asistencia
Date Date
Qty:
Subtotal
Checkout
Adobe Developer Connection / Centro de desarrollo de Fireworks /

Creating jQuery Mobile website themes in Fireworks using the CSS3 Mobile Pack

por Michael Dominic

Michael Dominic
  • Adobe

Content

  • Working with the jQuery Mobile framework
  • Creating and modifying a jQuery theme template
  • Generating jQuery CSS and sprites
  • Where to go from here

Created

3 October 2011

Herramientas de página

Compartir en Facebook
Compartir en Twitter
Compartir en LinkedIn
Marcar como favorito
Imprimir

Tags

Requisitos

Conocimientos previos

Basic familiarity working with Dreamweaver and Fireworks is required. Prior experience building websites with the jQuery Mobile Framework, HTML, and CSS is also recommended.

Nivel de usuario

Intermedio

Productos necesarios

  • Fireworks CSS3 Mobile Pack
  • Fireworks (Download trial)
  • Dreamweaver (Download trial)

In this article you'll learn how to work with the Adobe Fireworks CSS3 Mobile Pack to create and maintain mobile websites using the jQuery Mobile Framework.

The CSS3 Mobile Pack includes two new features:

  • CSS Properties panel: The CSS Properties extension maps all the properties of a Fireworks object that can be represented in CSS. It lists the equivalent CSS properties in the CSS Properties panel. To learn more about using this feature, read Extracting CSS properties from design objects in Fireworks using the CSS3 Mobile Pack.
  • jQuery Mobile theme skinning: The extension adds new functionality that enables you to create or update the theme of a jQuery Mobile website in Fireworks. After updating a site, you can display it inside the jQuery Mobile theme preview and export the corresponding CSS code and related sprite assets. This article describes how to work with the jQuery Mobile feature provided by the CSS Mobile Pack.

Working with the jQuery Mobile framework

The jQuery Mobile Framework is a JavaScript framework that allows you to quickly build websites for mobile devices. It is a touch-optimized web framework designed for smartphones and tablets. jQuery Mobile works on the vast majority of all modern desktop, smartphone, tablet, and e-reader platforms. The jQuery Mobile Framework is easy to use and includes web-specific controls such as buttons, sliders, list elements, and many more. When you build mobile websites with the jQuery Mobile Framework you can leverage the default theme provided with the framework.

The jQuery Mobile theme skinning extension enhances the Fireworks workspace to enable you to create or modify the default jQuery Mobile theme. It also generates the associated CSS style sheet and sprite assets. You can use the CSS generated by Fireworks to modify the default theme for jQuery Mobile pages to customize it for your projects.

This article describes how you can change or create jQuery Mobile themes using CSS3 Mobile Pack for Fireworks and how to apply the new or updated themes to your jQuery Mobile pages.

Before the CSS3 Mobile Pack was available, it was necessary to manually modify the CSS style sheet when you created a theme for a jQuery-based mobile website. Until recently, it wasn't possible to preview the site to check the appearance of the theme on the website. It was rather time-consuming because you had to switch between modifying the code on a web page and then previewing it in a browser until the desired theme changes were finalized.

The CSS3 Mobile Pack helps save time because you can now create or update a jQuery Mobile theme in Fireworks, preview it, and then generate the CSS style sheet and sprites for the site. When you apply the CSS code to your jQuery-based web pages for mobile devices, the theme is displayed exactly as it was when you previewed the design in Fireworks.

Using the jQuery Mobile Framework to design mobile sites

Every layout and widget included in jQuery Mobile is designed around a new object-oriented CSS framework. The framework makes it possible to apply a complete unified visual design theme to mobile sites and applications.

Consider the following benefits:

  • jQuery Mobile uses CSS3 properties to create rounded corners, box and text shadows, and gradients. Using CSS3 properties instead of images is advantageous because it reduces the size of the theme file and the number of server requests.
  • Themes include multiple color swatches—each consisting of a header bar, content body, and button states—that you can freely mix and match. These swatches enable you to create visual textures and richer designs.
  • Open-ended themes support up to 26 unique swatches per theme. This makes it possible to add almost unlimited variety to your designs.
  • All backgrounds now use CSS3 gradients to dramatically reduce the file size and number of server requests to improve performance.
  • A simplified icon set includes elements most commonly used for mobile, in a sprite format to reduce image weight.

The default theme contains the following five bar styles (see Figure 1):

Choose from five different default bar styles in the default theme.
Figure 1. Choose from five different default bar styles in the default theme.

By default, the framework assigns the "A" swatch to all headers and footers because header and footer elements are typically visually prominent in a mobile application. To set the color of a bar to a different swatch color, add the data-theme attribute to your header or footer and set an alternate swatch letter such as "B" or "D" to apply the specified theme swatch color. The CSS code generated for a bar is shown below:

{ border:1px solid #2a2a2a; background:#111; color:#fff;font-weight:bold; text-shadow:0 -1px 1px #000; background-image:-moz-linear-gradient(top,#3c3c3c,#111); background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3c3c3c),color-stop(1,#111)); -msfilter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#3c3c3c', EndColorStr='#111111')" }

To learn more about how the default theme works, read the jQuery Mobile Framework Theme Documentation.

Creating and modifying a jQuery theme template

The jQuery Mobile theme includes some default sprite images and swatches. You can use the functionality provided by the Fireworks extension to modify the sprites and swatches. You can also create multiple swatches by duplicating an existing page and customizing a copy of it.

Begin by creating a new theme:

  1. In Fireworks CS5, choose Commands > jQuery Mobile > Create New Theme to create a new theme (see Figure 2).
Create a new jQuery Mobile theme.
Figure 2. Create a new jQuery Mobile theme.

The page name is used to name the swatch. We recommend that you use a single character (a–z) when naming pages. You can create pages by duplicating existing pages and modifying the theme according to the requirement. Each page generates a unique CSS swatch.

The template contains the default sprites and related assets (see Figure 3).

fig03_thumb Ver más grande
Figure 3. Default jQuery template with global assets and default pages (click to enlarge).

Modifying a jQuery Mobile template

Using Fireworks, you can modify the skin based on the theme to match a site's design.

Follow these steps to modify an existing template to update it:

  1. Open a page in Fireworks and select the desired elements.
  2. Modify individual elements on the canvas. (For example, you can update colors, change text styles, add gradient fill, adjust the degree of rounded corners, apply effects such as drop shadows, or make other updates as desired.)
  3. Save the changes by choosing File > Save.

Each object on the canvas corresponds to a section of CSS code in a swatch. The code is indicated by the title of each object (see Figure 4).

fig04_thumb Ver más grande
Figure 4. Fireworks document after modifying the page (click to enlarge).

After making changes, the next step involves reviewing the recent changes to see how the design appears.

Previewing changes applied to a jQuery Mobile template

Follow these steps to preview the revised template file:

  1. Select Windows > Extensions > jQuery Mobile Theme Preview (see Figure 5).
Choose the option to preview the theme within the Fireworks workspace.
Figure 5. Choose the option to preview the theme within the Fireworks workspace.

The Preview panel appears and displays the updated page (see Figure 6).

Review the updates in the jQuery Mobile Theme Preview panel.
Figure 6. Review the updates in the jQuery Mobile Theme Preview panel.
  1. To preview all themes and sprites at once in a browser, select Commands > jQuery Mobile > Preview Theme in a Browser (see Figure 7).
Preview the themes in a browser.
Figure 7. Preview the themes in a browser.

Click the tabs along the top to switch between the different themes to preview individual swatches applied to various elements.

Generating jQuery CSS and sprites

After you have created or updated a template, you can use Fireworks to generate the jQuery CSS code and the sprites for the site. Choose between one of the following two options to export the CSS swatches and sprites.

Option 1: Export both the CSS and sprites simulataneously

To export all of the swatches and sprites at once, choose Commands > jQuery Mobile > Export Theme to generate the swatches and sprites for all pages (see Figure 8).

Choose Export Theme to generate jQuery CSS code and the related sprites.
Figure 8. Choose Export Theme to generate jQuery CSS code and the related sprites.

Option 2: Export a specific swatch or sprite individually

To export a particular swatch, click Export Current Swatch in the jQuery Mobile Theme Preview panel. Use this strategy when you want to customize only the bar of a particular swatch in order to update it (see Figure 9).

Figure 9. When you choose the Export Current Swatch option, only the current element is exported and updated.
Figure 9. When you choose the Export Current Swatch option, only the current element is exported and updated.

Applying the generated CSS file to a jQuery page

At this point you've created the new CSS style sheet file to update the mobile website theme. In this section, you'll learn how to link the CSS file to your mobile website. Follow these steps:

  1. Launch Dreamweaver CS5.5. Open an existing site or choose File > New and choose the options in the New Document dialog box to create a blank HTML page.
  2. Choose Insert > jQuery Mobile > Page to create a jQuery Mobile page. In the jQuery Mobile Files dialog box that appears, leave all the default settings and click OK.
    The page is created using the default jQuery theme, as defined in this tag:
<link href="jquery-mobile/jquery.mobile-1.0a3.min.css" rel="stylesheet" type="text/css" />
  1. Review the code to see how the CSS style sheet is linked to the HTML page (see Figure 10).
Figure 10. Below the title, the link tag hooks up the generic CSS style sheet file to the default jQuery HTML page in Dreamweaver.
Figure 10. Below the title, the link tag hooks up the generic CSS style sheet file to the default jQuery HTML page in Dreamweaver.
  1. In the Code window, edit the link to point to the jQuery CSS style sheet that you generated using Fireworks. Using this strategy, you can apply the new themes you create in Fireworks to the entire page or to specific elements of the page.

For example, rather than using the default "A" bar design, you can use code to apply a different bar style, like this:

<div data-role="page" id="page" data-theme="f">

After applying these changes, click the Live View button to review how the updated theme appears within the Dreamweaver workspace (see Figure 11).

fig11_thumb Ver más grande
Figure 11. Click Live View to review the recent changes in Dreamweaver after editing the page to apply the new theme (click to enlarge).

When you test, it's important to review the changes on the mobile device to make sure everything appears as expected. But when you are still designing the mobile app, you can save time by choosing File > Preview in Browser > Device Central to see how the content appears in a mobile emulator for the targeted device (see Figure 12).

Figure 12. Preview the updated theme in a mobile simulator.
Figure 12. Preview the updated theme in a mobile simulator.

Note: In accordance with the jQuery Mobile Framework, Fireworks does not export patterns to optimize the size of the exported content.

Where to go from here

As you've seen in this article, you can use the CSS3 Mobile Pack for Fireworks to create and update jQuery Mobile website themes to build and manage websites for devices. The updated interface includes the ability to generate the CSS style sheets that you can use to redesign mobile apps and sites.

Fireworks makes it easier than ever before to build and deploy web designs across multiple screens. Additionally, since the generated CSS is cross-platform compatible, the sites you create will perform and appear as expected on smartphones and tablets. Use the preview options in Dreamweaver to review the changes in Live View or in a browser in order to check your work before publishing the changes. You can also preview inside Fireworks.

To learn more about extending Fireworks to create CSS style sheets, read Extracting CSS properties from design objects in Fireworks using the CSS3 Mobile Pack, and watch the Fireworks senior product manager, Takashi Morifusa, demonstrate the CSS3 Properties panel and jQuery Mobile theme skinning tool. Also be sure also to check out the HTML5 and CSS3 Development Center.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License

More Like This

  • Prebuilt CSS templates in Fireworks
  • Designing a website application with Fireworks CS4
  • Designing a media player skin in Fireworks
  • Setting up a Fireworks web design mock-up for CSS and images export
  • Rapid interactive prototyping with HTML, CSS, and JavaScript using Fireworks and Dreamweaver CS4
  • Prototyping for the Apple iPhone using Fireworks
  • Extracting CSS properties from design objects in Fireworks using the CSS3 Mobile Pack
  • Mobile workflows using Fireworks CS5 and Device Central CS5
  • Prototyping AIR applications with Fireworks
  • Interaction design and rapid prototyping with Fireworks

Productos

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile apps
  • Photoshop
  • Touch Apps

Soluciones

  • Marketing digital
  • Medios digitales
  • Gestión de experiencias web

Sectores

  • Educación
  • Servicios financieros
  • Administración

Ayuda

  • Centros de soporte de productos
  • Pedidos y devoluciones
  • Descarga e instalación
  • Mi Adobe

Aprendizaje

  • Adobe Developer Connection
  • Adobe TV
  • Formación y certificación
  • Foros
  • Centro de diseño

Formas de comprar

  • Para uso personal y autónomos
  • Para estudiantes, profesores y empleados
  • Para estudiantes, profesores y empleados
  • Para empresas, centros educativos y gobiernos
  • Ofertas especiales

Descargas

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Empresa

  • Sala de noticias
  • Programas de socios
  • Responsabilidad social corporativa
  • Oportunidades laborales
  • Relaciones con los inversores
  • Actos
  • Jurídico
  • Seguridad
  • Contactar con Adobe
Seleccionar región España (Cambiar)
Seleccionar región Cerrar

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Condiciones de uso | Política de privacidad y cookies (Actualizado)