Skip to content

Commit

Permalink
Sidenote CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
ks0m1c_dharma committed Dec 22, 2023
1 parent c6e5c66 commit 78085fb
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
50 changes: 50 additions & 0 deletions assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,54 @@
url('/fonts/gotu/Gotu-Regular.woff') format('woff'),
url('/fonts/gotu/Gotu-Regular.ttf') format('ttf');
}

@font-face {
font-family: "et-book";
src: url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.eot");
src: url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.eot?#iefix") format("embedded-opentype"), url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.woff") format("woff"), url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.ttf") format("truetype"), url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.svg#etbookromanosf") format("svg");
font-weight: normal;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "et-book";
src: url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot");
src: url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot?#iefix") format("embedded-opentype"), url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff") format("woff"), url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.ttf") format("truetype"), url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.svg#etbookromanosf") format("svg");
font-weight: normal;
font-style: italic;
font-display: swap;
}

@font-face {
font-family: "et-book";
src: url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.eot");
src: url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.eot?#iefix") format("embedded-opentype"), url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.woff") format("woff"), url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.ttf") format("truetype"), url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.svg#etbookromanosf") format("svg");
font-weight: bold;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "et-book-roman-old-style";
src: url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot");
src: url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot?#iefix") format("embedded-opentype"), url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff") format("woff"), url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.ttf") format("truetype"), url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.svg#etbookromanosf") format("svg");
font-weight: normal;
font-style: normal;
font-display: swap;
}
/* This file is for your main application CSS */

.sidenote,
.marginnote {
float: right;
clear: right;
margin-right: -60%;
width: 50%;
margin-top: 0.3rem;
margin-bottom: 0;
font-size: 1.1rem;
line-height: 1.3;
vertical-align: baseline;
position: relative;
}
25 changes: 25 additions & 0 deletions lib/vyasa_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,30 @@ defmodule VyasaWeb.CoreComponents do
"""
end

@doc """
Renders a sidenote w action slots for interaction with sidenote
"""
attr :class, :string, default: nil
slot :inner_block, required: true
slot :subtitle
slot :actions

def sidenote(assigns) do
~H"""
<header class={[@actions != [] && "sidenote", @class]}>
<div>
<h1 class="text-lg font-semibold sidenote text-zinc-800">
<%= render_slot(@inner_block) %>
</h1>
<p :if={@subtitle != []} class="mt-2 text-sm sidenote leading-6 text-zinc-600">
<%= render_slot(@subtitle) %>
</p>
</div>
<div class="flex-none"><%= render_slot(@actions) %></div>
</header>
"""
end

@doc ~S"""
Renders a table with generic styling.
Expand Down Expand Up @@ -536,6 +560,7 @@ defmodule VyasaWeb.CoreComponents do
def list(assigns) do
~H"""
<div class="mt-14">
<%= render_slot(@inner_block) %>
<dl class="-my-4 divide-y divide-zinc-100">
<div :for={item <- @item} class="flex gap-4 py-4 text-sm leading-6 sm:gap-8">
<dt :if={Map.has_key?(item, :title)} class="w-1/6 flex-none text-zinc-500"><%= item.title %></dt>
Expand Down

0 comments on commit 78085fb

Please sign in to comment.