npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@liferay/bs3-bs4-compat

v1.0.3

Published

Bootstrap 3 to 4 Compatibility Layer for Liferay DXP

Downloads

375

Readme

Liferay Bootstrap 3 to 4 Compatibility Layer

NOTE: This package is meant to work in DXP 7.4 GA1 and we cannot garauntee it working with future releases of Liferay DXP. We will not be actively testing & maintaining this project for future releases of DXP and will only be fixing reported bugs for DXP 7.4 GA1.


With the removal of the Bootstrap 3 compatibility layer in Liferay DXP (LPS-123359), code that previously relied on legacy Bootstrap 3 markup no longer behaves as expected.

This built-in layer was always meant to work as a temporary band-aid that projects could use to get an upgrade done fast and out the door. Once the upgrade was completed, it was advised that the project was updated and the compat layer disabled as to speed up the site.

With the removal of the built-in layer, we speed up all pages by default avoiding to load a big amount of unnecessary CSS. However, developers still relying on this might have a hard time upgrading, so the goal of this project is to provide that layer as an external package.

Installation

$ npm install @liferay/bs3-bs4-compat
// or
$ yarn add @liferay/bs3-bs4-compat

Use

This compatibility layer is important to have at build time because our sass variables rely on ClayCSS. In order to use this layer, you must properly import it into your theme or wherever you load ClayCSS at.

Import Order

In order for sass to compile correctly, you must import them correctly so that it can get the right variables from ClayCSS.

  • Clay CSS: Clay must be added first so that the BS3-BS4 layer can read sass variables that come from Clay.
  • _atlas_variables.scss: This file contains variables specific to the atlas theme.
  • _components.scss: This file imports all component specific style overrides.
  • _variables.scss: This file contains variables for toggling specific compat components off.

Note: all three compat files are imported into main.scss in that specific order.

Adding to a Theme

You need to import the .scss files into your theme. Below is an example of adding it to the styled and classic themes in DXP.

Styled Theme

modules/apps/frontend-theme/frontend-theme-styled/src/css/clay.scss

@import 'clay/base';

+ @import '@liferay/bs3-bs4-compat/scss/variables';

+ @import '@liferay/bs3-bs4-compat/scss/components';

Classic Theme

modules/apps/frontend-theme/frontend-theme-classic/src/css/clay.scss

@import 'clay/atlas';

+ @import '@liferay/bs3-bs4-compat/scss/variables';

+ @import '@liferay/bs3-bs4-compat/scss/atlas_variables';

+ @import '@liferay/bs3-bs4-compat/scss/components';

After making this change and deploying to your DXP bundle, you should see the compatibility layer working.