Skip to content

Commit

Permalink
chore: remove prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
woylie committed Nov 8, 2023
1 parent ab43ba7 commit 118d986
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ end
classes named `.is-*` or `.has-*`.
- Provide a base CSS class for each component to support unstyled or
alternatively styled variations of the same HTML elements.
- Prefix CSS class names with a library-specific shorthand (`dg-`) to avoid
conflicts and aid in recognition.
- The library is designed without default styles and does not prefer any
particular CSS framework.
28 changes: 14 additions & 14 deletions lib/doggo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ defmodule Doggo do
def alert(assigns) do
~H"""
<div id={@id} role="alert" class={["alert", alert_level_class(@level)]}>
<div class="dg-alert-icon">
<div class="alert-icon">
<.icon_sprite name={alert_icon(@level)} />
</div>
<div class="dg-alert-body">
<div :if={@title != []} class="dg-alert-title">
<div class="alert-body">
<div :if={@title != []} class="alert-title">
<%= render_slot(@title) %>
</div>
<div class="dg-alert-message"><%= render_slot(@inner_block) %></div>
<div class="alert-message"><%= render_slot(@inner_block) %></div>
</div>
<button
:if={@show_close_button}
on_click={maybe_clear_flash(@clear_flash, @level) |> JS.hide(to: "##{@id}")}
aria-label={@close_button_label}
class="dg-alert-close"
class="alert-close"
>
<.icon_sprite name="x" />
</button>
Expand Down Expand Up @@ -135,7 +135,7 @@ defmodule Doggo do
~H"""
<span
class={[
"dg-icon",
"icon",
icon_size_class(@size),
label_placement_class(@label_placement),
@class
Expand Down Expand Up @@ -201,7 +201,7 @@ defmodule Doggo do
~H"""
<span
class={[
"dg-icon",
"icon",
icon_size_class(@size),
label_placement_class(@label_placement),
@class
Expand Down Expand Up @@ -283,8 +283,8 @@ defmodule Doggo do
To hide the modal when the `open` attribute is not set, use the following CSS
styles:
dialog.dg-modal:not([open]),
dialog.dg-modal[open="false"] {
dialog.modal:not([open]),
dialog.modal[open="false"] {
display: none;
}
Expand Down Expand Up @@ -316,7 +316,7 @@ defmodule Doggo do
~H"""
<dialog
id={@id}
class={["dg-modal", @class]}
class={["modal", @class]}
aria-modal={(@open && "true") || "false"}
aria-labelledby={"#{@id}-title"}
open={@open}
Expand All @@ -327,7 +327,7 @@ defmodule Doggo do
>
<.focus_wrap
id={"#{@id}-container"}
class="dg-modal-container"
class="modal-container"
phx-window-keydown={JS.exec("data-cancel", to: "##{@id}")}
phx-key="escape"
phx-click-away={JS.exec("data-cancel", to: "##{@id}")}
Expand All @@ -336,7 +336,7 @@ defmodule Doggo do
<header>
<.link
href="#"
class="dg-modal-close"
class="modal-close"
aria-label="Close"
phx-click={JS.exec("data-cancel", to: "##{@id}")}
>
Expand All @@ -345,7 +345,7 @@ defmodule Doggo do
</.link>
<h2 id={"#{@id}-title"}><%= render_slot(@title) %></h2>
</header>
<div id={"#{@id}-content"} class="dg-modal-content">
<div id={"#{@id}-content"} class="modal-content">
<%= render_slot(@inner_block) %>
</div>
<footer :if={@footer != []}>
Expand Down Expand Up @@ -406,7 +406,7 @@ defmodule Doggo do

def property_list(assigns) do
~H"""
<dl class={["dg-property-list", @class]} {@rest}>
<dl class={["property-list", @class]} {@rest}>
<div :for={prop <- @prop}>
<dt><%= prop.label %></dt>
<dd><%= render_slot(prop) %></dd>
Expand Down

0 comments on commit 118d986

Please sign in to comment.