Arbitrary values for Bootsrap? - vue.js

I am currently developing a web application. I am using Bootstrap-vue in frontend. Does Bootstrap has feature in which I can create on-the-fly class? Tailwind has it . I tried searching it in the internet but no luck.
Here is my case:
Color values are save in the database.
Every time the page loads, I will fetch those colors and create class based on their colors
Your help is much appreciated. Thanks in advance.

Bootstrap is not really an utility-based CSS framework, hence there is nothing similar to Tailwind because it's not the mindset of the tool.
Also, even if this kind of code exists in Tailwind, it can become funky pretty quick and the best thing is still to write some bare simple vanilla CSS code alongside your template to get what you want.
You won't get any performance benefit by using an arbitrary value anyway and hence it should be used for exceptional cases anyway, a CSS declaration will be far more cleaner.
Feel free to create global CSS variables in vanilla CSS for your use case.

Related

Better style inside a vue.js app or outsource to the site embedding it?

I'm building my first vue.js app and I'd like to have some help on deciding a design approach.
This app is going to be embedded inside a page of a site - built with Drupal 8.
Both app and site are going to use bootstrap 4 as base framework and we're going to use sass to style.
It's a quite simple app: a multistep form with some ajax call done to the aforementioned site.
It has anyway some components - one for each step, for some of the more complex input, for a sidebar showing the result of the ajax calls and so on.
I need to decide the "guideline" for styling this app and I'd like to get some help\insight to what solution is better.
On one hand, I could put the style inside the app itself; on the other hand I could leave all the style to the one present on the site.
As far as I can see the benefits of the first approach are the use of scope of each module, thus having a better "modularity".
However, putting the style all inside the site would avoid code duplication - simple example: custom color variables.
Personally I can't see for now other differences right now.
I haven't found material about the suggested approach and the pros\cons.
Could advice me of which approach is the best? Thank you.
It depends on the project, but you can make a list of cons and pros based on your project brief. If there are very few (or 0) changes in the future or it's based only on small components (not much style) then go with component-scoped styling. If the project is big, always go with a style pattern like the 7-1 pattern
I prefer working with the 7-1 pattern pattern.
Pros:
- Scalability or future updates like you mentioned the color variables case.
- You don't depend on Javascript to load the style, depending on how you write the app or how it loads, it may have glitches.

How to generate and scan barcodes with aurelia?

I have a webpage that needs to be able to generate and later read barcodes. But i cannot seem to find any small scale addon to aurelia that does even one of these. Is there any libary that does this or do i have to write my own somehow? Or can i somehow use some preexisting barcode stuff that is not directly designed for aurelia?
looks like you have to find a suitable library for the task on npm.
For barcode generation, you can use this test app:
https://codesandbox.io/embed/barcodes-bxgf1
Be sure to adapt to your own bundling choice.
I used quaggaJS in my aurelia app for reading existing bar codes.
(it's actually just a regular JS package - not specially for aurelia)
the API is kind of old (callbacks instead of promises), and overall it's a little weird (the Initialization process), but in the end it works great with little effort.
you can use https://www.npmjs.com/package/qr-scanner only draw back is that your website need to be https.

xmlpackages needed for extension of aspdotnetstorefront application?

I am currently getting my head around aspdotnetstorefront.
My initial thought is to build usercontrols or something else instead of xmlpackages for extending the functionality of aspdotnetstorefront. Is there a reason why I have to use the xmlpackages instead of something else?
There are a few reasons I would choose to use the XMLPackages. First, it is what the products use for layout, so it is easier to replace existing packages. ASPDNSF has built a bunch of functions for the XMLPackages to give you access to their core functionality. You can use the XMLPackages in topics and the templates, so no need to roll your own code. Finally, if you have simple html and javascript to return, it is nice to just use XSLT to do it. Yes, the learning curve is a bit steep, but depending on what you are doing, it makes life easier.
HTH
Wade

using dojox.mobile and dijit together

We are trying to make an app maker with dijit. Do you know what to do more or less to have the dojox.mobile.* branch running parallel to my dijit app ?
I know there is a seperate dojox.mobile.parser,... I guess, I need to fork it quite deep ?
I thought first about an iFrame but we need drag'n drop from the designer and the simulator.
Any help is welcome,
g
dojox.mobile offers a very light-weight parser which can be used in place of the standard dojo.parser. I think it skips stuff like attachpoints and probably wouldn't work too well with Dijit, so if you use both types of widgets on your page, stick with dojo.parser. The parsers share some globals and are unable to co-exist, so do NOT load both.

dynamic content - where do i start?

I have a rather simple question. I want to dynamically change the content of a based on the selection of a drop down menu. The drop down menu is populated by a php loop that gets data from a mysql database. So far, I'm only familiar with php and html/css.
I don't really know where to start, or more specifically, what technologies I should be researching. So far, I've heard AJAX, JQuery, JavaScript, NOLOH, HTML iframes, pure CSS, etc. I really just want to know where to look!
Start off with the basics: HTML (if you're feeling adventurous, you could try HTML5) and CSS.
After your comfortable with that, you can start getting a little more complex and pick up JavaScript. This is how the majority of the 'dynamic' bits of web pages are accomplished so learn it well.
Once you've got the JavaScript basics down, you can learn how to use JavaScript to manipulate the DOM (Document Object Model) and make AJAX requests back to the server to get new content to insert.