diff --git a/bookwyrm/static/css/bookwyrm.css b/bookwyrm/static/css/bookwyrm.css index 8f95cfeb..4d27c2a4 100644 --- a/bookwyrm/static/css/bookwyrm.css +++ b/bookwyrm/static/css/bookwyrm.css @@ -159,19 +159,33 @@ body { /** Book covers * - * - The context gives the extrinsic dimensions. - * - .cover-container gives the intrinsic dimensions and position. + * - .is-cover gives the behaviour of the cover and its surrounding. + * - .cover-container gives the dimensions and position (for borders, image and other elements). * - .book-cover is positioned and sized based on its container. + * + * To have the cover with specific dimensions, specify a width or height for + * standard bulma’s named breapoints: + * + * is-[w|h]-[xs|s|m|l|xl]-[mobile|tablet|desktop] ******************************************************************************/ +.column.is-cover { + flex-grow: 0 !important; +} + +.column.is-cover, +.column.is-cover + .column { + flex-basis: auto !important; +} + .cover-container { display: flex; + justify-content: center; + align-items: center; position: relative; + width: max-content; + max-width: 100%; overflow: hidden; - min-width: 80px; - min-height: 100px; - max-width: max-content; - outline: solid 1px #dbdbdb; } /* Book cover @@ -278,46 +292,231 @@ body { min-height: 96px !important; } -.is-h-small { +.is-w-auto { + width: auto !important; +} + +.is-w-xs { + width: 80px !important; +} + +.is-w-s { + width: 100px !important; +} + +.is-w-m { + width: 150px !important; +} + +.is-w-l { + width: 200px !important; +} + +.is-h-xs { + height: 80px !important; +} + +.is-h-s { height: 100px !important; } -.is-h-medium { +.is-h-m { height: 150px !important; } +.is-h-l { + height: 200px !important; +} + @media only screen and (max-width: 768px) { - .is-h-medium-mobile { - height: 150px; + .is-w-auto-mobile { + width: auto !important; + } + + .is-w-xs-mobile { + width: 80px !important; + } + + .is-w-s-mobile { + width: 100px !important; + } + + .is-w-m-mobile { + width: 150px !important; + } + + .is-w-l-mobile { + width: 200px !important; + } + + .is-h-xs-mobile { + height: 80px !important; + } + + .is-h-s-mobile { + height: 100px !important; + } + + .is-h-m-mobile { + height: 150px !important; + } + + .is-h-l-mobile { + height: 200px !important; } } -.is-min-w-none { - min-width: auto !important; +@media only screen and (min-width: 769px) { + .is-w-auto-tablet { + width: auto !important; + } + + .is-w-xs-tablet { + width: 80px !important; + } + + .is-w-s-tablet { + width: 100px !important; + } + + .is-w-m-tablet { + width: 150px !important; + } + + .is-w-l-tablet { + width: 200px !important; + } + + .is-h-xs-tablet { + height: 80px !important; + } + + .is-h-s-tablet { + height: 100px !important; + } + + .is-h-m-tablet { + height: 150px !important; + } + + .is-h-l-tablet { + height: 200px !important; + } +} + +@media only screen and (min-width: 1024px) { + .is-w-auto-desktop { + width: auto !important; + } + + .is-w-xs-desktop { + width: 80px !important; + } + + .is-w-s-desktop { + width: 100px !important; + } + + .is-w-m-desktop { + width: 150px !important; + } + + .is-w-l-desktop { + width: 200px !important; + } + + .is-h-xs-desktop { + height: 80px !important; + } + + .is-h-s-desktop { + height: 100px !important; + } + + .is-h-m-desktop { + height: 150px !important; + } + + .is-h-l-desktop { + height: 200px !important; + } } /* Alignments ******************************************************************************/ /* Flex item position - * - * This is for a default `flex-direction: row`. * -------------------------------------------------------------------------- */ -.align-r { - justify-content: flex-end; +.align { + display: flex !important; + flex-direction: row !important; +} + +.align.to-c { + justify-content: center !important; +} + +.align.to-r { + justify-content: flex-end !important; +} + +.align.to-l { + justify-content: flex-start !important; +} + +@media screen and (max-width: 768px) { + .align.to-c-mobile { + justify-content: center !important; + } + + .align.to-r-mobile { + justify-content: flex-end !important; + } + + .align.to-l-mobile { + justify-content: flex-start !important; + } } @media screen and (min-width: 769px) { - .align-r-tablet { - justify-content: flex-end; + .align.to-c-tablet { + justify-content: center !important; + } + + .align.to-r-tablet { + justify-content: flex-end !important; + } + + .align.to-l-tablet { + justify-content: flex-start !important; } } /* Spacings ******************************************************************************/ +.mr-auto { + margin-right: auto !important; +} + +.ml-auto { + margin-left: auto !important; +} + @media screen and (max-width: 768px) { + .mr-auto-mobile { + margin-right: auto !important; + } + + .ml-auto-mobile { + margin-left: auto !important; + } + + .ml-3-mobile { + margin-left: 0.75rem !important; + } + .my-3-mobile { margin-top: 0.75rem !important; margin-bottom: 0.75rem !important; @@ -325,6 +524,14 @@ body { } @media screen and (min-width: 769px) { + .mr-auto-tablet { + margin-right: auto !important; + } + + .ml-auto-tablet { + margin-left: auto !important; + } + .ml-3-tablet { margin-left: 0.75rem !important; } diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html index 23f7dac0..a9932910 100644 --- a/bookwyrm/templates/book/book.html +++ b/bookwyrm/templates/book/book.html @@ -48,7 +48,7 @@
- {% include 'snippets/book_cover.html' with book=book cover_class='is-h-medium-mobile' %} + {% include 'snippets/book_cover.html' with book=book cover_class='is-h-m-mobile' %} {% include 'snippets/rate_action.html' with user=request.user book=book %}
diff --git a/bookwyrm/templates/book/edit_book.html b/bookwyrm/templates/book/edit_book.html index 0cb1a9b1..de9c9535 100644 --- a/bookwyrm/templates/book/edit_book.html +++ b/bookwyrm/templates/book/edit_book.html @@ -170,7 +170,7 @@

{% trans "Cover" %}

- {% include 'snippets/book_cover.html' with book=book cover_class='is-h-small' %} + {% include 'snippets/book_cover.html' with book=book cover_class='is-h-s' %}
diff --git a/bookwyrm/templates/book/editions.html b/bookwyrm/templates/book/editions.html index 009bdd66..dd580234 100644 --- a/bookwyrm/templates/book/editions.html +++ b/bookwyrm/templates/book/editions.html @@ -14,11 +14,11 @@
{% for book in editions %}
-
- {% include 'snippets/book_cover.html' with book=book cover_class='is-h-medium' %} +
+ {% include 'snippets/book_cover.html' with book=book cover_class='is-w-m is-h-m align to-l-mobile' %}
-
+

{{ book.title }} @@ -26,7 +26,7 @@

{% with book=book %} -
+
{% include 'book/publisher_info.html' %}
diff --git a/bookwyrm/templates/discover/small-book.html b/bookwyrm/templates/discover/small-book.html index c1f5f165..f0e1626c 100644 --- a/bookwyrm/templates/discover/small-book.html +++ b/bookwyrm/templates/discover/small-book.html @@ -6,7 +6,7 @@ {% with book=book %}
{% include 'snippets/book_cover.html' with cover_class='is-h-small' %} + >{% include 'snippets/book_cover.html' with cover_class='is-h-s' %} {% include 'snippets/stars.html' with rating=book|rating:request.user %} diff --git a/bookwyrm/templates/feed/feed_layout.html b/bookwyrm/templates/feed/feed_layout.html index 669c2aaa..75fc1951 100644 --- a/bookwyrm/templates/feed/feed_layout.html +++ b/bookwyrm/templates/feed/feed_layout.html @@ -37,7 +37,7 @@ aria-label="{{ book.title }}" aria-selected="{% if active_book == book.id|stringformat:'d' %}true{% elif shelf_counter == 1 and forloop.first %}true{% else %}false{% endif %}" aria-controls="book-{{ book.id }}"> - {% include 'snippets/book_cover.html' with book=book cover_class='is-h-medium' %} + {% include 'snippets/book_cover.html' with book=book cover_class='is-h-m' %} {% endfor %} diff --git a/bookwyrm/templates/import_status.html b/bookwyrm/templates/import_status.html index 05c811d2..3ce929e6 100644 --- a/bookwyrm/templates/import_status.html +++ b/bookwyrm/templates/import_status.html @@ -125,7 +125,7 @@ {% if item.book %} - {% include 'snippets/book_cover.html' with book=item.book cover_class='is-h-small' %} + {% include 'snippets/book_cover.html' with book=item.book cover_class='is-h-s' %} {% endif %} diff --git a/bookwyrm/templates/lists/curate.html b/bookwyrm/templates/lists/curate.html index 529f51c3..492b399b 100644 --- a/bookwyrm/templates/lists/curate.html +++ b/bookwyrm/templates/lists/curate.html @@ -25,23 +25,23 @@ mb-6 " > -
+
-
+
{% trans "Suggested by" %} diff --git a/bookwyrm/templates/lists/list.html b/bookwyrm/templates/lists/list.html index 0b1b05d3..b28c469d 100644 --- a/bookwyrm/templates/lists/list.html +++ b/bookwyrm/templates/lists/list.html @@ -37,13 +37,13 @@ columns is-mobile is-gapless " > -
+ -
+
{% include 'snippets/book_titleby.html' %} {% include 'snippets/stars.html' with rating=item.book|rating:request.user %} {% include 'snippets/shelve_button/shelve_button.html' %} @@ -133,11 +133,15 @@ {% if suggested_books|length > 0 %} {% for book in suggested_books %}
- -
+

{% include 'snippets/book_titleby.html' with book=book %}

diff --git a/bookwyrm/templates/lists/list_items.html b/bookwyrm/templates/lists/list_items.html index f1a4938e..b59e2a96 100644 --- a/bookwyrm/templates/lists/list_items.html +++ b/bookwyrm/templates/lists/list_items.html @@ -13,8 +13,8 @@ {% if list_books %} diff --git a/bookwyrm/templates/snippets/search_result_text.html b/bookwyrm/templates/snippets/search_result_text.html index e234c82c..663ef865 100644 --- a/bookwyrm/templates/snippets/search_result_text.html +++ b/bookwyrm/templates/snippets/search_result_text.html @@ -1,6 +1,8 @@ {% load i18n %}
- {% include 'snippets/book_cover.html' with book=result cover_class='column' img_path=false %} +
+ {% include 'snippets/book_cover.html' with book=result cover_class='is-w-xs is-h-xs' img_path=false %} +

diff --git a/bookwyrm/templates/snippets/status/content_status.html b/bookwyrm/templates/snippets/status/content_status.html index b2946b83..31ba33b5 100644 --- a/bookwyrm/templates/snippets/status/content_status.html +++ b/bookwyrm/templates/snippets/status/content_status.html @@ -10,27 +10,30 @@ {% endif %} > -

+
{% if not hide_book %} - {% with book=status.book|default:status.mention_books.first %} - {% if book %} -
-
-
- {% include 'snippets/book_cover.html' with book=book %} - {% include 'snippets/stars.html' with rating=book|rating:request.user %} - {% include 'snippets/shelve_button/shelve_button.html' with book=book %} -
-
-

{{ book|book_description|to_markdown|default:""|safe|truncatewords_html:15 }}

-
-
-
- {% endif %} - {% endwith %} + {% with book=status.book|default:status.mention_books.first %} + {% if book %} +
+
+
+ {% include 'snippets/book_cover.html' with book=book cover_class='is-h-xs is-h-l-tablet' %} + + {% include 'snippets/stars.html' with rating=book|rating:request.user %} + + {% include 'snippets/shelve_button/shelve_button.html' with book=book %} +
+ +
+

{{ book|book_description|to_markdown|default:""|safe|truncatewords_html:15 }}

+
+
+
+ {% endif %} + {% endwith %} {% endif %} -
+
{% if status_type == 'Review' %}

-
-
- {% include 'snippets/book_cover.html' with book=book cover_class='is-h-small' %} + {% with book=status.book|default:status.mention_books.first %} +
+ + {% include 'snippets/book_cover.html' with book=book cover_class='is-h-xs is-h-s-tablet' %} + + +
+

+ {% include 'snippets/book_titleby.html' with book=book %} +

+ +

+ {{ book|book_description|to_markdown|default:""|safe|truncatewords_html:20 }} +

+ + {% include 'snippets/shelve_button/shelve_button.html' with book=book %} +
-
-
-

{% include 'snippets/book_titleby.html' with book=book %}

-

{{ book|book_description|to_markdown|default:""|safe|truncatewords_html:20 }}

- {% include 'snippets/shelve_button/shelve_button.html' with book=book %} -
-
-{% endwith %} + {% endwith %} {% endif %} {% endspaceless %} diff --git a/bookwyrm/templates/user/user.html b/bookwyrm/templates/user/user.html index 80dac213..444385fe 100644 --- a/bookwyrm/templates/user/user.html +++ b/bookwyrm/templates/user/user.html @@ -36,7 +36,7 @@ {% for book in shelf.books %} {% endfor %}