1

I got stuck with overriding default Looback API Explorer logo name with custom name.

I tried following css style but it only appends the text like Looback API Explorer Test API Explorer but what I want is only Test API Explorer

#logo:after { 
  content: "Test API Explorer";
  color: #fff; /* set color to original text color */
  /* margin-left equals length of text we're replacing */
}

Does anyone had same situation and found solution?

Hemadri Dasari
  • 32,666
  • 37
  • 119
  • 162
  • I've found the answer from https://stackoverflow.com/questions/28073421/how-to-modify-the-strongloops-loopback-explorer-css/28088915#28088915. See if it helps. – user3524882 Oct 02 '18 at 02:48

2 Answers2

1

I am able to replace my custom logo name in place of Looback API Explorer by adding below css style in loopbackStyles.css file

.swagger-ui-wrap #logo{
  display: none;
}
.swagger-ui-wrap:after { 
  content: "MyOwn API Explorer";
  color: #fff;
  font-weight: bold; 
}
Hemadri Dasari
  • 32,666
  • 37
  • 119
  • 162
  • I think that Swagger name is dependent on your 'package.json' attribute *name*. Ie: { "name": "your_project_name", ... } – F3L1X79 Oct 03 '18 at 13:24
0

LoopBack explorer logo and name are taken from the "Loopback-component-explorer" folder which is inside node_modules. In order to change it, you can go to "node_module>Loopback-component-explorer>public>index.html" Here you can write anything or design page according to you. For CSS you can find CSS folder here. And yes, it will not affect anything in your backend. Hope it will help. cheers check image here

  • 1
    No you really shouldn't directly refactor dependencies in `node_modules`, this will break the portability of the app or package as any changes to the `node_modules` will be lost when you deploy to a different environment (and you absolutely shouldn't commit the `node_modules` to your repo - [see here](https://medium.com/@chaitanyagiri/defending-my-choice-to-commit-node-modules-to-git-8eb02badd279)) or any time `npm install` or update is run. – Nick Mitchell Jul 29 '21 at 10:08