phlex-ruby / phlex.fun

Website and documentation for Phlex
https://phlex.fun
MIT License
23 stars 17 forks source link

Remove manual register of `<style>` element #12

Closed marcoroth closed 1 year ago

marcoroth commented 1 year ago

This pull request removes the manual register of the <style> element in components/layout.rb

phlex now also supports <style> elements since they were added in 0.2.0 via https://github.com/joeldrapper/phlex/pull/123

I guess with the introduction of https://github.com/joeldrapper/phlex/pull/449 this now started failing with:

phlex/lib/phlex/html.rb:444:in `method_added': 👋 Redefining the method `Components::Layout#_style` is not a good idea. (Phlex::NameError)
from phlex/lib/phlex/elements.rb:35:in `alias_method'
from phlex/lib/phlex/elements.rb:35:in `register_element'
from phlex/lib/phlex/elements.rb:10:in `class_eval'
from phlex/lib/phlex/elements.rb:10:in `register_element'
from phlex.fun/components/layout.rb:5:in `<class:Layout>'
from phlex.fun/components/layout.rb:4:in `<module:Components>'
from phlex.fun/components/layout.rb:3:in `<top (required)>'
joeldrapper commented 1 year ago

Thanks 🙌