Gemini Migration
When migrating from the "Gemini" design system to "Mercury," you'll be transitioning your project's styles, components, and design principles to align with the new system. This process involves updating your codebase to replace Gemini-specific components and styles with their Mercury equivalents, ensuring consistency with Mercury's guidelines. The migration guide will provide you with step-by-step instructions to help make this transition as smooth as possible.
1. gxg-accordion
When transitioning from a gxg-accordion
:
- Replace the
gxg-accordion
tag with ach-accordion-render
tag. - Remove all the attributes and values.
- Add the
accordion-filled
oraccordion-outlined
class in order to apply the Mercury styles. - Remove all the
gxg-accordion-item
items, since thech-accordion-render
uses a model instead. - Assign a model like the one provided in the following example
(objectsAccordionModel)
- Read Mercury documentation to see how to apply some common cases
- Refer to the Chameleon documentation for the complete specifications.
Note:
The following Mercury example uses a spacing utility class.spacing-body
, that applies padding all around the accordion item content. To use the.spacing-body
you will need to include the propper bundle:utils/spacing
.
BEFORE
AFTER
2. gxg-button: Text only
When transitioning from a gxg-button
that is "only text":
- Replace the
gxg-button
tag with abutton
tag. - Remove all the attributes and values.
- Add any of the mercury classes that apply for "text only" button types
BEFORE
AFTER
3. gxg-button: Text with icon
When transitioning from a gxg-button
that is "text with icon":
- Replace the
gxg-button
tag with abutton
tag. - Remove all the attributes and values.
- Add the
button-icon-and-text
class. - Insert a
ch-image
inside thebutton
and follow the documentation for using an icon
BEFORE
AFTER
4. gxg-columns
When transitioning from a gxg-columns
:
- Replace the
gxg-columns
tag with a.layout
+.layout--cols-*
tags, where * is any of the available combinations. - Remove all the attributes and values.
- Replace all the
gxg-column
tags withdiv.layout__panel
tags. Each column content goes inside this tags. - Refer to the Mercury documentation for complete details.
BEFORE
AFTER
5. gxg-combo-box
When transitioning from a gxg-combo-box
:
- Replace the
gxg-select
tag with ach-combo-box-render
tag. - Remove all the attributes and values.
- Add the
combo-box
class in order to apply the Mercury styles. - Remove all the
gxg-combo-box-item
items, since thech-combo-box-render
uses a model instead. - Assign a model like the one provided in the following example
(favoriteCarsModel)
- Read Mercury documentation to see how to apply some common cases
- Refer to the Chameleon documentation for the complete specifications.
BEFORE
AFTER
6. gxg-form-checkbox
When transitioning from a gxg-form-checkbox
:
- Replace the
gxg-form-checkbox
tag with ach-checkbox
tag. - Remove all the attributes and values.
- Add the
checkbox
class. - Specify the control properties following the documentation
BEFORE
AFTER
7. gxg-form-radio-group
When transitioning from a gxg-form-radio-group
:
- Replace the
gxg-form-radio-group
tag with ach-radio-group-render
tag. - Remove all the attributes and values.
- Add the
radio-group
class. - Specify the control properties following the documentation
BEFORE
AFTER
8. gxg-form-text
When transitioning from a gxg-form-text
:
- Replace the
gxg-form-text
tag with ach-edit
tag. - Remove all the attributes and values.
- Add the
input
class. - Specify the control properties following the documentation
BEFORE
AFTER
9. gxg-form-textarea
When transitioning from a gxg-form-textarea
:
- Replace the
gxg-form-textarea
tag with ach-edit
tag. - Remove all the attributes and values.
- Add the
input
class. - Specify the control properties following the documentation
BEFORE
AFTER
10. gxg-grid
When transitioning from a gxg-grid
:
- Replace the
gxg-grid
tag with ach-tabular-grid
tag. - Remove all the attributes and values.
- Add the
tabular-grid
class. - Specify the control properties following the documentation
BEFORE
AFTER
11. gxg-icon
When transitioning from a gxg-icon
:
- Replace the
gxg-icon
tag with ach-image
tag. - Remove all the attributes and values.
- Add the
icon-sm
oricon-md
class. - Specify the control properties following the documentation
BEFORE
AFTER
12. gxg-label
When transitioning from a gxg-label
:
- Replace the
gxg-label
tag with alabel
tag. - Remove all the attributes and values.
- Add the
label
class.
BEFORE
AFTER
13. gxg-list-box
When transitioning from a gxg-list-box
:
- Replace the
gxg-list-box
tag with ach-action-list-render
tag. - Remove all the attributes and values.
- Add the
list-box
class.
BEFORE
AFTER
14. gxg-modal
When transitioning from a gxg-modal
: If you want to open a dialog similar to others in the IDE, it's best to use the IDE services to do so. You can find documentation and examples in the plugins repository.
BEFORE
AFTER
15. gxg-pills
When transitioning from a gxg-pills
:
- Replace the
gxg-pills
tag with ach-combo-box-render
tag. - Remove all the attributes and values.
- Add the
pill
class.
BEFORE
AFTER
16. gxg-select
When transitioning from a gxg-select
:
- Replace the
gxg-select
tag with ach-combo-box-render
tag. - Remove all the attributes and values.
- Add the
combo-box
class in order to apply the Mercury styles. - Remove all the
gxg-option
items, since thech-combo-box-render
uses a model instead. - Assign a model like the one provided in the following example
(carsComboBoxModel)
- Read Mercury documentation to see how to apply some common cases
- Refer to the Chameleon documentation for the complete specifications.
BEFORE
AFTER
17. gxg-stack
When transitioning from a gxg-stack
:
Gemini's gxg-stack
was used to evenly space components or elements with a consistent gap. The gap size was defined as a property, selected from a predefined set of spacing tokens.
While this solution provided some visual consistency, the spacing value chosen by the user was free, causing the same type of elements to have different gap values in different sections.
In Mercury, the gap between elements is determined by the design system and depends on the type of context. At the time of writting, the only existing vertical gap is generated for controls, by the .field-group
class, within which form fields (.field
) are placed.
Read Mercury documentation to see how to apply some common cases
BEFORE
AFTER
18. gxg-suggest
When transitioning from a gxg-list-box
:
- Replace the
gxg-list-box
tag with ach-action-list-render
tag. - Remove all the attributes and values.
- Add the
list-box
class. - Specify the ch-combo-box-render items following the model property
- Set the
suggest
property totrue
to turn the suggest feature on. - Subscribe to the
filterChange
event listener, and use theevent.detail
to filter the items accordingly, by defining thefilter
value. - Specify the options by following the
suggestOptions
property
BEFORE
AFTER
19. gxg-tabs
When transitioning from a gxg-tabs
:
- Replace the
gxg-tabs
tag with ach-tab-render
tag. - Remove all the attributes and values.
- Add the
tab
class. - Specify the control properties following the documentation
BEFORE
AFTER
20. gxg-text
When transitioning from a gxg-text
:
- Replace the
gxg-text
tag with ap
tag. - Remove the
type
attribute/value - Add the
body
class.
BEFORE
AFTER
21. gxg-title
When transitioning from a gxg-title
:
- Replace the
gxg-title
tag with ah*
tag. - Remove the
type
attribute/value - Add the
heading-*
class.
BEFORE
AFTER
22. gxg-tree-view
When transitioning from a gxg-tree-view
:
- Replace the
gxg-tree-view
tag with ach-tree-view-render
tag. - Remove all the attributes and values.
- Add the
tree-view
class.
BEFORE
AFTER