How to use with another exciting framework

As we mention multiple times, on our site 😅, Fylgja is component based framework, meaning you can download and use each CSS component separately.

Making it easier to combine and use with other CSS frameworks or to add it to an existing project.

So ho…


This content originally appeared on DEV Community and was authored by Sean van Zuidam

As we mention multiple times, on our site 😅, Fylgja is component based framework, meaning you can download and use each CSS component separately.

Making it easier to combine and use with other CSS frameworks or to add it to an existing project.

So how do you actually do this?

First make sure to understand what compiler your running. There are 2 use cases;

  • SCSS based
  • PostCSS based with postcss-import

most other tools have no impact with using Fylgja.

How to use with Utility based frameworks, like TailwindCSS

So for example if you are running a TailwindCSS or other utility CSS based framework, like WindiCSS, thats one of the easiest use cases.

The only components that might conflict are the Utilpack, Transition and Transform components, since these are also utility based CSS components.

So if you are using TailwindCSS you can simply install the @fylgja/form component and include it in your CSS like this.

@import "tailwindcss/base";
@import "tailwindcss/components";

@import "@fylgja/form";

@import "tailwindcss/utilities";

And now you don't need to add any CSS classes for your form elements, since the @fylgja/form component styles them directly.

Noice

And this way you can also add more and more Fylgja CSS components without having to create them with utility classes.

So instead having to us @apply to create a Card component, You can just include it, just as with the form. The only difference is the Fylgja Card component uses classes, but that is just wat we want, moving to a more DRY approach and still using the flexibly of utility classes. 😄

How to use with Component based frameworks, like Bootstrap

This is a little harder since some components already exists, so make sure to disable the CSS Component you want to replace.

So you can add CSS Components that don't exist in Bootstrap, or replace existing ones with Fylgja CSS components.

For Bootstrap you could extend the utilities with our Utilpack component, adding more utility power, or add some Native CSS components like the form to simplify the HTML.

So how do you actually remove CSS components from Bootstrap?

First make sure that you don't import Bootstrap using a single import. Instead load everything from the bootstrap.scss file separately,

@import "bootstrap";

load everything separately, like this;

// Configuration
@import "functions";
@import "variables";
@import "mixins";
@import "utilities";

// Layout & components
@import "root";
@import "reboot";
@import "type";
...
@import "offcanvas";
@import "placeholders";

// Helpers
@import "helpers";

// Utilities
@import "utilities/api";

and include this in your main.css with the newer @use syntax.

Now in your main.css add your Fylgja Components like you normally do. And in your custom Bootstrap import, you can disable unused components or components you want to replace with Fylgja Components.

This Post and Guide is originally from the Fylgja site


This content originally appeared on DEV Community and was authored by Sean van Zuidam


Print Share Comment Cite Upload Translate Updates
APA

Sean van Zuidam | Sciencx (2021-11-27T15:33:52+00:00) How to use with another exciting framework. Retrieved from https://www.scien.cx/2021/11/27/how-to-use-with-another-exciting-framework/

MLA
" » How to use with another exciting framework." Sean van Zuidam | Sciencx - Saturday November 27, 2021, https://www.scien.cx/2021/11/27/how-to-use-with-another-exciting-framework/
HARVARD
Sean van Zuidam | Sciencx Saturday November 27, 2021 » How to use with another exciting framework., viewed ,<https://www.scien.cx/2021/11/27/how-to-use-with-another-exciting-framework/>
VANCOUVER
Sean van Zuidam | Sciencx - » How to use with another exciting framework. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/27/how-to-use-with-another-exciting-framework/
CHICAGO
" » How to use with another exciting framework." Sean van Zuidam | Sciencx - Accessed . https://www.scien.cx/2021/11/27/how-to-use-with-another-exciting-framework/
IEEE
" » How to use with another exciting framework." Sean van Zuidam | Sciencx [Online]. Available: https://www.scien.cx/2021/11/27/how-to-use-with-another-exciting-framework/. [Accessed: ]
rf:citation
» How to use with another exciting framework | Sean van Zuidam | Sciencx | https://www.scien.cx/2021/11/27/how-to-use-with-another-exciting-framework/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.