Commit d2464395 authored by alexpott's avatar alexpott

Issue #2405445 by crazyrohila: Refactor book module CSS files inline with our CSS standards

parent cdc9a448
...@@ -12,9 +12,3 @@ navigation: ...@@ -12,9 +12,3 @@ navigation:
css: css:
theme: theme:
css/book.theme.css: {} css/book.theme.css: {}
admin:
version: VERSION
css:
theme:
css/book.admin.css: {}
...@@ -150,19 +150,17 @@ function book_form_node_form_alter(&$form, FormStateInterface $form_state, $form ...@@ -150,19 +150,17 @@ function book_form_node_form_alter(&$form, FormStateInterface $form_state, $form
if ($access) { if ($access) {
$collapsed = !($node->isNew() && !empty($node->book['pid'])); $collapsed = !($node->isNew() && !empty($node->book['pid']));
$form = \Drupal::service('book.manager')->addFormElements($form, $form_state, $node, $account, $collapsed); $form = \Drupal::service('book.manager')->addFormElements($form, $form_state, $node, $account, $collapsed);
// Since the "Book" dropdown can't trigger a form submission when // The "js-hide" class hides submit button when Javascript is enabled.
// JavaScript is disabled, add a submit button to do that. book.admin.css hides
// this button when JavaScript is enabled.
$form['book']['pick-book'] = array( $form['book']['pick-book'] = array(
'#type' => 'submit', '#type' => 'submit',
'#value' => t('Change book (update list of parents)'), '#value' => t('Change book (update list of parents)'),
'#submit' => array('book_pick_book_nojs_submit'), '#submit' => array('book_pick_book_nojs_submit'),
'#weight' => 20, '#weight' => 20,
'#attached' => [ '#attributes' => array(
'library' => [ 'class' => array(
'book/admin', 'js-hide',
], ),
], ),
); );
$form['#entity_builders'][] = 'book_node_builder'; $form['#entity_builders'][] = 'book_node_builder';
} }
......
/**
* @file
* Administration styles for the Book module.
*/
/**
* Book outline on book edit form.
*/
.js .book-outline-form .form-submit {
display: none;
}
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
* Styling for the Book module. * Styling for the Book module.
*/ */
/**
* Book navigation.
*/
.book-navigation .menu { .book-navigation .menu {
padding-bottom: 0; padding-bottom: 0;
padding-top: 1em; padding-top: 1em;
...@@ -15,29 +12,29 @@ ...@@ -15,29 +12,29 @@
overflow: auto; overflow: auto;
padding: 0.5em 0; padding: 0.5em 0;
} }
.book-pager li { .book-pager__item {
display: inline-block; display: inline-block;
list-style-type: none; list-style-type: none;
vertical-align: top; vertical-align: top;
} }
.book-pager .previous { .book-pager__item--previous {
text-align: left; /* LTR */ text-align: left; /* LTR */
width: 45%; width: 45%;
} }
[dir="rtl"] .book-pager .previous { [dir="rtl"] .book-pager__item--previous {
float: right; float: right;
text-align: right; text-align: right;
} }
.book-pager .up { .book-pager__item--center {
text-align: center; text-align: center;
width: 8%; width: 8%;
} }
.book-pager .next { .book-pager__item--next {
float: right; /* LTR */ float: right; /* LTR */
text-align: right; /* LTR */ text-align: right; /* LTR */
width: 45%; width: 45%;
} }
[dir="rtl"] .book-pager .next { [dir="rtl"] .book-pager__item--next {
float: left; float: left;
text-align: left; text-align: left;
} }
...@@ -35,17 +35,17 @@ ...@@ -35,17 +35,17 @@
<h2 class="visually-hidden" id="book-label-{{ book_id }}">{{ 'Book traversal links for'|t }} {{ book_title }}</h2> <h2 class="visually-hidden" id="book-label-{{ book_id }}">{{ 'Book traversal links for'|t }} {{ book_title }}</h2>
<ul class="book-pager"> <ul class="book-pager">
{% if prev_url %} {% if prev_url %}
<li class="previous"> <li class="book-pager__item book-pager__item--previous">
<a href="{{ prev_url }}" rel="prev" title="{{ 'Go to previous page'|t }}"><b>{{ '‹'|t }}</b> {{ prev_title }}</a> <a href="{{ prev_url }}" rel="prev" title="{{ 'Go to previous page'|t }}"><b>{{ '‹'|t }}</b> {{ prev_title }}</a>
</li> </li>
{% endif %} {% endif %}
{% if parent_url %} {% if parent_url %}
<li class="up"> <li class="book-pager__item book-pager__item--center">
<a href="{{ parent_url }}" title="{{ 'Go to parent page'|t }}">{{ 'Up'|t }}</a> <a href="{{ parent_url }}" title="{{ 'Go to parent page'|t }}">{{ 'Up'|t }}</a>
</li> </li>
{% endif %} {% endif %}
{% if next_url %} {% if next_url %}
<li class="next"> <li class="book-pager__item book-pager__item--next">
<a href="{{ next_url }}" rel="next" title="{{ 'Go to next page'|t }}">{{ next_title }} <b>{{ '›'|t }}</b></a> <a href="{{ next_url }}" rel="next" title="{{ 'Go to next page'|t }}">{{ next_title }} <b>{{ '›'|t }}</b></a>
</li> </li>
{% endif %} {% endif %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment