I'm a junior backend dev having trouble setting up asset pipeline on Rails 7 using sprockets
Basically I need to support four different CSS Framework in one Rails application:
using tailwind for the landing page (landing.css)
using bootstrap 4 for old admin page (admin-v1.css)
using bootstrap 5 for newly developed admin page (admin-v2.css)
using simple css for test page (test.css)
I can't find example anywhere to split the output of CSS asset pipeline.
It's unusual to just use one css framework, because we bought the theme from third party provider, which include CSS that will be very hard to build from scratch.
How to use multiple different css framework on Rails 7?
Related
I am beginner to Angular. i do not know how do support a website for multilingual using angular 11.And i have some dynamic contents in the website .I want this to include the multilingual support. can anyone please help me
There are different solutions. You can use angular built in i18n (https://angular.io/guide/i18n-overview). But it requires handling bundles with server because angular i18n creates separate bundle for each language you want in your application. For example, if user switches to english you should load bundle for english language and reload the page and same for other languages.
Another one is Transloco (https://ngneat.github.io/transloco/) which is popular. It will allow you change i18n in runtime without creating multiple bundles. You need to configure app to work with this package and create json files with keys and translated values for each language. Transloco has good documentation and examples.
Another popular is ngx-translate (https://github.com/ngx-translate/core) which works similar to Transloco.
Also if your project is small you can handle translations manually (update/add new ones) but in case of large project better way is to upload i18n resource files to 3rd party services where translator will translate everything and you can then import translated files to your project.
So it depends of your project which one to select but you can compare advantages and disadvantages and choose necessary.
I made a Microsoft Model driven application I need to integrate third party libraries like Bootstrap etc. Is there any way to customize css or support for the third party libraries for the application?
You can upload the custom css file as Dynamics CRM (aka Model driven PowerApps) web resources and use them as needed further.
Same way, third party libraries like Bootstrap JS, css files also can be uploaded as CRM web resource files, some people prefer the cdn files as well.
Read my other answer
Various Ruby on Rails tutorials encourage the instillation of the bootstrap-sass gem. Why is this a convention rather than point to a CDN?
I've included in header of my app:
<!-- BOOTSTRAP CSS 3.3.5 CDN: --> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
And in the footer:
<!-- BOOTSTRAP JS 3.3.5 CDN --><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" type="text/javascript"></script>
Assuming I am always working from a development box that is connected to the internet: What is the reasoning behind using the bootstrap gem rather than just pointing to a CDN? Isn't it always faster to point to a CDN where a client is likely to have the file already cached?
The likely reason that Rails' tutorials suggest the bootstrap-sass gem is just a matter of convenience; as Rails' developers we're used to adding a line to our Gemfile to integrate 3rd party libraries.
There are added benefits to the gem: after you do a bundle install you won't need an internet connection to load your development environment's assets (no need to connect to an external CDN). Also you can use SASS to override Bootstrap mixin variables and customize the framework.
These benefits aside, if you aren't customizing Bootstrap there is no need to use the boostrap-sass gem in production. In fact your argument about clients possibly already having CDN hosted versions of common JS/CSS frameworks is certainly valid.
Short answer: don't think of the boostrap-sass gem as a convention. It's a good starting point for customization but if no customization is needed it is perfectly reasonable to go with a CDN.
Using the CDN merely gives you CSS, hard-wiring your HTML files to a specific bootstrap version. Using the SASS/LESS version of bootstrap on the contrary allows you to put semantic classes on your HTML, and make the connection between your semantic classes and Bootstrap in your app specific SASS/LESS files (using #import, #extend ... statements)
If you use this technique wisely, you will end up with smaller sized downloads since you only import the parts of bootstrap you actually use in your application, and you will have clean separation of concerns, allowing you to switch sass/less frameworks without touching your HTML files (ideally).
Does anyone know a good, complete, simple asp.net project that implements Twitter bootstrap.
I want to create a website that uses ASP.net and is responsive and uses bootstrap. That involves probably a lot of libraries and links to jquery, etcetera. The first time it is a lot of investigation and somebody must have done this before and might be willing to give me a head start.
Thanks in advance!
ASP.Net Web Forms Template and MVC Template come with Twitter Bootstrap already.
Once you select Web Forms Template or MVC Template (Screen Shot 2), it'll download all required styles, scripts and fonts via NuGet
I've been using Foundation 4 (and jumping into 5 now) for the past 6 months or so and I've created a couple responsive products and used it as a test to learn and work with SASS/Compass.
I've got a request from a client for a simple, static site - and I'm wondering if anyone who works with Foundation regularly had any advice on whether they are using foundation to create small/non-responsive sites with SASS/Compass or if they went another way with a framework.
Simple blog + 5 static pages for a small company.
Considering it is a static, simple blog site, you could use Jekyll with GitHub Pages. All you'd need is an account on GitHub now that they let you use a custom domain. No hosting required. Foundation would work too although I prefer Semantic UI.