Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom library icons full sync #25

Open
eelcoj opened this issue Nov 29, 2024 · 2 comments
Open

Custom library icons full sync #25

eelcoj opened this issue Nov 29, 2024 · 2 comments
Labels
question Further information is requested

Comments

@eelcoj
Copy link
Collaborator

eelcoj commented Nov 29, 2024

There is currently the option to render custom icons. In (main) you can run rails generate rails_icons:initializer --custom=simple_icons and it will add the following to config/initializer/rails_icons.rb:

config.libraries.merge!(
  {
    custom: {
      simple_icons: {
        path: "app/assets/svg/icons/simple_icons",
        default: {
          css: "size-6"
        }
      }
    }
  }
)

Useful for for one (or a few) icons you manually download. But would be useful to allow to sync custom libraries too? So non-first-party libraries can be synced too?

API/interface could be the same, eg. rails generate rails_icons:initializer --custom=simple_icons. Then in the custom configuration something like this could be added:

config.libraries.merge!(
  {
    custom: {
      simple_icons: {
        sync: {
          url: "https://github.com/some_repo/library_name.git",
          variants: {
            ".": "icons"
          }
        },
        path: "app/assets/svg/icons/simple_icons",
        default: {
          css: "size-6"
        }
      }
    }
  }
)

Not 100% sure if useful. As a PR with the correct config for a new library would be pretty simple (thanks to @jordancalhoun!).

@eelcoj eelcoj added the question Further information is requested label Nov 29, 2024
@jordancalhoun
Copy link
Contributor

I love the idea of updating this to support syncing any set of icons following the format defined in the 'SET' for the three we currently have defined in there. I think it could be setup with minimal work for more flexibility by the end user without needing to fork/submit a PR. Would allow anyone to keep their icon sets up to date without any manual work.

Is this what you had in mind?

@eelcoj
Copy link
Collaborator Author

eelcoj commented Nov 30, 2024

That's what I had in mind, indeed.

I like the versatility of it, but unsure how big the upside is (vs the amount of code/added complexity).

I just added the Feather library and this is really all it takes: https://github.com/Rails-Designer/rails_icons/pull/29/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants