Nothing beats organized, automated, and simplified code, so Webegin's source is built with the best tools for maintainable development.
Seamlessly integrate your Visualforce pages into Salesforce1 with Webegin's styled elements for a consistent user experience.
Meticulously developed with maintainability in mind, Webegin allows you to get down and dirty with the source code when needed.
With Webegin's 12-column floating grid system, you are able to create intricate, responsive layouts for all sorts of content types.
Need to add a padding-bottom
of 3px
? Ditch those inline styles and fine-tune your block elements with .adjust-p-b-3
instead.
Augment your grid and adjustment classes with the -tl
(tablet landscape), -tp
(tablet portrait), and -p
(phone) class affixes.
Resembling Salesforce1, Webegin for Visualforce comes pre-styled with five headings that can be used throughout your copy. Each heading carries its own set of font-size
, line-height
, and color
properties.
Other elements, including paragraphs, unordered lists, and ordered lists are also pre-styled.
Webegin for Visualforce supports floated grids (with the .grid
class) and flexbox grids (with the .flex-grid
class), along with classes for managing breakpoint layouts, float direction, and column spacing. Columns require the .column
class, and sizing is determined by an associated .span-n
class, where n represents a numerator over 12 (100% width).
Class affixes for enabling sizing within breakpoints include -tl
for tablet landscape, -tp
for tablet portrait, and -p
for phone. Adding the .margin-span-n
class will add a margin of the specified size in the same direction as the float, and accepts all breakpoint-related affixes. These margin classes, however, are not supported on flexbox grids.
Grids with the .negate-padding
class will negate the spacing of its descendant columns, which may be desireable when making use of the .padded
class on columns for gutters.
column span-6 span-12-p
column span-4 span-12-p
column span-2
column float-right span-3 span-4-tl span-8-p
column float-right span-6 margin-span-1 span-2-tp span-1-p
column float-right span-2 span-12-tl span-3-p
column span-6-tl span-4-tp span-6-p
column span-6 span-8-tl span-12-tp
column span-6 span-4-tl span-12-tp span-6-p
<button>
tags will automatically carry Salesforce1's button styles. <a>
tags with the .button
class and input[type="submit"]
elements extend these styles.
Buttons can make use of the colors from the Colors Section by including a class based on the color's name (e.g., .light-blue
for Light Blue). They can also make use of the .inverse
class, which turns its background transparent and applies the specified color to the color
and border-color
CSS properties.
Dropdown buttons can also be created by adding the .dropdown
class to any button. A sibling <ul>
element with the .dropdown-options
class containing the options as links will need to be present for the dropdown to function.
Buttons can also be grouped to tie together related actions by use of a <ul>
tag with the .button-group
class. <a>
and <button>
tags within list items will be styled like the buttons above even without the .button
class.
Button groups should be contained by the .button-group-container
to ensure its inline properties match those of a normal button. This can be useful for having multiple button groups together on one line.
Button groups can be used several ways: as a normal button group (stacks vertically on mobile), as a button with dropdown with alternative dropdown choices, or as paginate links (by substituting the .button-groups
class with the .paginate-links
class. A normal button group can also utilize the .mobile-full-width
class, which gives all vertically stack buttons in the group 100% width.
Cards are containers which visually separate key points of data for your app. You can use the .card
class on any <article>
or <div>
, and add <section>
tags within to further establish hierarchy. <section>
tags can make use of the .border-top
or .border-bottom
classes to add lines between them.
Sections being used as card headers have a few optional classes available to them, including the .has-buttons
class (allows for spacing to accommodate buttons which float to the right) and the .mobile-header
class (emulates the Salesforce1 page header on mobile).
Using the .has-buttons
class also allows you to use the .has-subhead
class on a contained <h2>
to override it's top margin, allowing for room to include an <h3>
. The .has-subhead
class also overrides the top margin on a sibling <h3>
, which can be useful in headers with a subhead, with or without buttons.
Like cards, dialogs can contain any type of content, but are meant to be callouts or violators for your layout. You can create dialogs with the .dialog
class.
Each dialog consists of two parts: the .left
container and the .right
container. The .left
container can be empty (to display a colored border), contain an icon, or display an image, while the .right
container houses the content for the dialog.
The .left
container can utilize color classes to edit its background-color
.
Icons included in the .left
container are automatically centered vertically.
The .left
container can also use the .image
class along with an inline style to define a .background-image
to display an avatar.
Card lists can be used to stylize boring-looking <ul>
elements by use of the .card
class. These elements can act purely as groups of content, or as mobile-friendly navigation.
Making card list navigation is as easy as wrapping the <li>
text in an <a>
tag; the styling will be applied automatically.
The .loading
class can be applied to any block-level element or contianer to add a loading state and disable click events. This can come in handy during AJAX calls.
Dynamic content incoming. Stay tuned!
For the sake of this demo, nothing is actually being loaded. But we can pretend something great is about to happen.
Statuses are inline-block elements used to describe the state of your content. They can be created by adding the .status
class on <span>
tags.
The .avatar
and .icon-container
classes function similarly, though the .avatar
class is applied directly to an <img>
tag and the .icon-container
class is used to contain a <span>
with an icon font. Both classes can make use of the .large
class for displaying larger imagery or using icons in the hero region.
"This framework is awesome! I plan on using it for all of my Salesforce1 apps. I like cats."
Accordions are <div>
tags which can reveal relevant content following a click event. This can be achieved by adding the .accordion
class on that <div>
, and adding a sibling <div>
with the class of .accordion-content
, which will contain the content for the accordion.
If the element with the .accordion-content
class is not present and an accordion is clicked, an error will be logged.
Alerts are block-level elements that can be used to display an error message, show additional information, or prompt a user to take action. They are created by adding the .alert
class to a <div>
.
Alerts can also make use of the .dismissible
class and a .close-alert
child element that will close the alert when clicked. An alert can also be triggered on click events by using the .js-open-alert
class and data-alert-id
attribute on the element that will trigger the alert.
Webegin for Visualforce has form elements themed to match Salesforce1's forms. Additional input types are also available, including date pickers, tags, and autocomplete fields. These fields display an associated icon if wrapped in special containers (.date-picker-container
class, .tags-container
class, and .autocomplete-container
class). The select element also has a special container for a dropdown icon (.select-container
class).
Forms can also make use of the .required
class on <label>
elements to denote required fields with a red asterisk. Additionally, if the form produces an error on validation, the <input>
, <select>
. and <ul>
(for tags, which use the .js-tags
class) elements can make use of the .error
class, which highlights the fields that require attention in red.
Progress bars help to communicate with your audience how far along they may be in a process, or current progress on a task they are involved with. They are created with the use of the .progress-bar
class, which acts as a container to <span>
tags that represent individual segments of progress.
Each <span>
tag requires both the .progress
class and the data-percentage
attribute, which defines how the inline-block element would be sized in relation to its container. The widths of these <span>
tags are applied by jQuery via inline styles.
Tooltips on an element can be activated with the .js-tooltip
class and associated title
attribute, which defines the text that is to be displayed on the tooltip.
Mobile users will not be able to trigger tooltips by default, as the settings listen for a mouseover event.
Tables can be constructed with standard HTML markup, and are available in the two styles highlighted below. The first is a standard, classless table with a blue <thead>
and grey alternating rows, and the second is a table with the .list
class, which carries more simplified styling.
You can contain tables in a .table-container
class to control overflow when the table's widths are longer than that of the viewport or container.
Person | No. of Dogs | No. of Cats |
Kevin | 1 | 1 |
Mako | 2 | 1 |
Ryan | 0 | 0 |
Ana | 0 | 1 |
Person | No. of Dogs | No. of Cats | No. of Plants | No. of Pet Rocks |
Kevin | 1 | 1 | 0 | 6 |
Mako | 2 | 1 | 0 | 0 |
Ryan | 0 | 0 | 0 | 1 |
Ana | 0 | 1 | 1 | 0 |
The .reveal
class can be added to any element that you wish to animate into the viewport after page load. The animation is triggered when the app is scrolled to a point where the element enters the viewport. The class automatically hides element on page load and would initiate the animation immediately if the page is loaded/reloaded while the element is positioned past the trigger point.
Thank you for bringing me into this world!
The .modal
class can be used on a container element that you wish to reveal when a link or button is clicked, and are styles similarly to cards. In order for the modal window to trigger properly, the link or button tasked with opening the modal requires a .js-open-modal
class and a data-modal-id
attribute, which specifies the id
of the target modal.
Webegin is developed and maintained by Kevin Beronilla, and is a series of front-end development starting points for multiple uses. Webegin for Visualforce is a version of Webegin specifically for Salesforce1 development, and has extended styles to mimic those of the Salesforce1 app.
Included is a Node.js package and Gulp file for handling common watch tasks including preprocessing, minification, and vendor prefixing. Also included is a configuration file for a custom Mixture project for those who still have a working install of the application.