We have three types of components on Open Library:
- CSS Components: Components which only require a little bit of CSS. These could have a separate HTML template file in
openlibrary/templates
if it makes sense to have one, and will usually have a separate .less file instatic/css/components
. Note the .less file must then be imported from the corresponding page's .less file, E.g.static/css/page-user.less
. - JavaScript/JQuery components: These are components which require a small amount of functionality, or are legacy implementations. E.g. the
multi-input-autocomplete
. These will have a JS file inopenlibrary/plugins/openlibrary/js
, and an import line inopenlibrary/plugins/openlibrary/js/index.js
. - Vue components: For new, more interactive components, we prefer to use Vue.js. These components will have a
.vue
file inopenlibrary/components
. For more info on Vue, read the README in that directory. E.g: LibraryExplorer.vue
All these components make use of BEM class notation to define the c