Overview: Resource packages | MVC
Once you create pages and templates in Sitefinity CMS, you need to modify their markup and style them. You do this with the help of resource packages. They group your resources in separate folders and apply these resources on your pages and templates. A package can contain style sheets, scripts, images, task running configuration, widget templates, and layout templates.
Sitefinity CMS automatically creates a ResourcePackages folder in the root of your project. This folder contains all resource packages. By default, with Sitefinity CMS you get the Bootstrap package but you can add your own packages in the ResourcePackages folder.
You can have several packages with different package names. However, a specific page or page template can only use one package.
Bootstrap resource packages
With Sitefinity CMS, you have the option to work with two versions of the Bootstrap package, both installed out-of-the-box. You can choose to work with either Bootstrap 4 or Bootstrap 3 package, with each package including the capabilities of the respective Bootstrap frontend framework version. For more information, see the Bootstrap site.
For more information about the structure of the Bootstrap packages and the location of frontend assets, see:
Both Bootstrap packages contain frontend assets, CSS source files, widget templates, based on the framework, such as News, Blogs, Images, and so on.
NOTE: The Bootstrap 3 package also contains grunt configuration, which is not required for the Bootstrap 4 package.
We recommend that for new projects you use the Bootstrap 4 package to your project since it provides you with the following benefits:
- Npm scripts infrastructure
Bootstrap 4 comes with updated build infrastructure — it no longer relies on Grunt but rather uses npm scripts. To enhance customization capabilities, Bootstrap 4 package provides you with various configuration options in package.json. Such options include package distribution folder name, styles distribution folder name, main SCSS import file name, and so on. In addition, redundant and time-consuming tasks are removed from the package, for example, the tasks for icon font generation and JavaScript concatenation.
- SVG icons with Font Awesome
Following the latest trends, Bootstrap 4 package uses Font Awesome with solid SVG icon sprites. All icons are vector graphics, so you can easily scale them while maintaining perfect quality. For more information, see the official documentation of Font Awesome about SVG sprites.
- RTL support
With Bootstrap 4, RTL support for multilingual sites is turned on by default. When RTL support is not needed, you can always switch off the RTL option via the settings in the SCSS variables file.
- Accessibility improvements
With Bootstrap 4 package and its significant accessibility improvements, you easily meet accessibility standards such as WCAG 2.1 Level AA or section 508. Bootstrap 4 follows the most common accessibility best practices for developers and provides out-of-the-box support for:
- Keyboard support
- Enhanced error handling
- Forms that meet accessibility standards
- Wai-aria
- Automatic detection of page language
- Accessible captcha
NOTE:Keep in mind that meeting website accessibility standards is a collective effort that requires designers, developers, and content authors working together. This is an iterative process and each subsequent change must be made with accessibility in mind and be properly tested.
To get better acquainted with website accessibility standards and important tips, check the following:
Bootstrap and responsive design
Bootstrap frontend framework enables you to build and develop apps that are responsive, mobile-first, and work seamlessly on any device – desktop or mobile. All MVC widgets are built with mobile-first mindset and their responsive design is based on the Bootstrap frontend framework.
NOTE: The Navigation widget is an exception. For more information, see Add customizable grid widgets to MVC templates.
For details on the supported browsers and devices by Bootstrap, see:
Following are a few key best practices to keep in mind when developing CSS or custom grid widgets in regard to responsive design and Bootstrap:
- To avoid having excessively long pages, hide content that is not that important
- Put the most important content on top of the page, so it is above the fold and page visitors can see it
- Use SVG files and responsive images
- Design for thumb interactions and tap interactions in mind, for example, buttons and links with larger interaction areas
- Mind typography and readability on different screen sizes
- Use fluid and adaptive layout by default
- NOTE: If you are working with the grid widgets that use the Bootstrap grid system, the layout is fluid by default.
- Test on mobile
Minimal resource package
Minimal is a basic package, which contains all default templates of the frontend widgets, such as News, Blogs, and Images, as plain HTML, minimal CSS, and a basic grunt configuration.
RECOMMENDATION: We recommend you to use the Minimal package in case you want to use a frontend framework other than Bootstrap. Like the Bootsrap package, Minimal has a task-runner configuration that helps processing styles, scripts, images, and so on.
The structure of the Minimal resource package is the same as that of the Bootstrap package, as it also contains minimal front-end assets, widget templates, grid widget templates and grunt configuration. For more information, see GitHub Minimal repository.