Commit 6c8fe4bd authored by alexpott's avatar alexpott

Issue #2214241 by mortendk, mdrummond, lauriii, galooph, ShaunDychko,...

Issue #2214241 by mortendk, mdrummond, lauriii, galooph, ShaunDychko, jjcarrion, b0unty, joelpittet, scor, amitgoyal, aboros, Manuel Garcia, hkirsman, BLadwin, hussainweb, sushilkr, emma.maria, nlisgo, yched, LewisNyman, davidhernandez, mikl, camoa, dman, dodorama: Field default markup - removing the divitis
parent ac15de31
......@@ -1474,8 +1474,6 @@ function template_preprocess_region(&$variables) {
* - element: A render element representing the field.
* - attributes: A string containing the attributes for the wrapping div.
* - title_attributes: A string containing the attributes for the title.
* - content_attributes: A string containing the attributes for the content's
* div.
*/
function template_preprocess_field(&$variables, $hook) {
$element = $variables['element'];
......@@ -1492,11 +1490,22 @@ function template_preprocess_field(&$variables, $hook) {
// readers.
$variables['label'] = $element['#title'];
// @todo Check for is_object() required due to pseudo field used in
// quickedit_test_entity_view_alter(). Remove this check after this is fixed
// in https://www.drupal.org/node/2550225.
$variables['multiple'] = is_object($element['#items']) ? $element['#items']->getFieldDefinition()->getFieldStorageDefinition()->isMultiple() : FALSE;
static $default_attributes;
if (!isset($default_attributes)) {
$default_attributes = new Attribute;
}
// Merge attributes when a single-value field has a hidden label.
if ($element['#label_display'] == 'hidden' && !$variables['multiple'] && is_object($element['#items'][0])) {
$variables['attributes'] = NestedArray::mergeDeep($variables['attributes'], (array) $element['#items'][0]->_attributes);
}
// We want other preprocess functions and the theme implementation to have
// fast access to the field item render arrays. The item render array keys
// (deltas) should always be numerically indexed starting from 0, and looping
......
......@@ -128,9 +128,9 @@ public function form(FieldItemListInterface $items, array &$form, FormStateInter
'#parents' => array_merge($parents, array($field_name . '_wrapper')),
'#attributes' => array(
'class' => array(
'field-type-' . Html::getClass($this->fieldDefinition->getType()),
'field-name-' . Html::getClass($field_name),
'field-widget-' . Html::getClass($this->getPluginId()),
'field--type-' . Html::getClass($this->fieldDefinition->getType()),
'field--name-' . Html::getClass($field_name),
'field--widget-' . Html::getClass($this->getPluginId()),
),
),
'widget' => $elements,
......
......@@ -84,13 +84,13 @@ public function testCommentFieldDelete() {
$this->drupalLogin($this->webUser);
$this->drupalGet('node/' . $node->nid->value);
$elements = $this->cssSelect('.field-type-comment');
$elements = $this->cssSelect('.field--type-comment');
$this->assertEqual(2, count($elements), 'There are two comment fields on the node.');
// Delete the first comment field.
FieldStorageConfig::loadByName('node', 'comment')->delete();
$this->drupalGet('node/' . $node->nid->value);
$elements = $this->cssSelect('.field-type-comment');
$elements = $this->cssSelect('.field--type-comment');
$this->assertEqual(1, count($elements), 'There is one comment field on the node.');
}
......
......@@ -62,7 +62,7 @@
// Store the actual value of this field. We'll need this to restore the
// original value when the user discards his modifications.
this.$textElement = this.$el.find('.field-item').eq(0);
this.$textElement = this.$el.find('.field__item').eq(0);
this.model.set('originalValue', this.$textElement.html());
},
......
......@@ -115,7 +115,7 @@ function testBooleanField() {
$display = entity_get_display($entity->getEntityTypeId(), $entity->bundle(), 'full');
$content = $display->build($entity);
$this->setRawContent(\Drupal::service('renderer')->renderRoot($content));
$this->assertRaw('<div class="field-item">' . $on . '</div>');
$this->assertRaw('<div class="field__item">' . $on . '</div>');
// Test if we can change the on label.
$on = $this->randomMachineName();
......
......@@ -119,6 +119,9 @@ protected function setUp() {
function testFieldItemListView() {
$items = $this->entity->get($this->fieldName);
\Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save();
// No display settings: check that default display settings are used.
$build = $items->view();
$this->render($build);
......
......@@ -72,6 +72,10 @@ class EntityReferenceFormatterTest extends EntityUnitTestBase {
protected function setUp() {
parent::setUp();
// Use Classy theme for testing markup output.
\Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save();
// Grant the 'view test entity' permission.
$this->installConfig(array('user'));
Role::load(RoleInterface::ANONYMOUS_ID)
......@@ -185,18 +189,14 @@ public function testEntityFormatter() {
$build = $this->buildRenderArray([$this->referencedEntity, $this->unsavedReferencedEntity], $formatter);
// Test the first field item.
$expected_rendered_name_field_1 = '<div class="field field-entity-test--name field-name-name field-type-string field-label-hidden">
<div class="field-items">
<div class="field-item">' . $this->referencedEntity->label() . '</div>
</div>
</div>
';
$expected_rendered_body_field_1 = '<div class="field field-entity-test--body field-name-body field-type-text field-label-above">
<div class="field-label">Body</div>
<div class="field-items">
<div class="field-item"><p>Hello, world!</p></div>
</div>
</div>
$expected_rendered_name_field_1 = '
<div class="field field--name-name field--type-string field--label-hidden field__item">' . $this->referencedEntity->label() . '</div>
';
$expected_rendered_body_field_1 = '
<div class="clearfix text-formatted field field--name-body field--type-text field--label-above">
<div class="field__label">Body</div>
<div class="field__item"><p>Hello, world!</p></div>
</div>
';
$renderer->renderRoot($build[0]);
$this->assertEqual($build[0]['#markup'], 'default | ' . $this->referencedEntity->label() . $expected_rendered_name_field_1 . $expected_rendered_body_field_1, sprintf('The markup returned by the %s formatter is correct for an item with a saved entity.', $formatter));
......
......@@ -337,7 +337,7 @@ function testImageFieldDefaultImage() {
$this->drupalGet('node/' . $node->id());
// Verify that no image is displayed on the page by checking for the class
// that would be used on the image field.
$this->assertNoPattern('<div class="(.*?)field-name-' . strtr($field_name, '_', '-') . '(.*?)">', 'No image displayed when no image is attached and no default image specified.');
$this->assertNoPattern('<div class="(.*?)field--name-' . strtr($field_name, '_', '-') . '(.*?)">', 'No image displayed when no image is attached and no default image specified.');
$cache_tags_header = $this->drupalGetHeader('X-Drupal-Cache-Tags');
$this->assertTrue(!preg_match('/ image_style\:/', $cache_tags_header), 'No image style cache tag found.');
......
......@@ -31,8 +31,8 @@
$context.find('.node-form-author').drupalSetSummary(function (context) {
var $authorContext = $(context);
var name = $authorContext.find('.field-name-uid input').val();
var date = $authorContext.find('.field-name-created input').val();
var name = $authorContext.find('.field--name-uid input').val();
var date = $authorContext.find('.field--name-created input').val();
return date ?
Drupal.t('By @name on @date', {'@name': name, '@date': date}) :
Drupal.t('By @name', {'@name': name});
......
......@@ -41,7 +41,7 @@ public function testMultiByteUtf8() {
$this->assertTrue(mb_strlen($title, 'utf-8') < strlen($title), 'Title has multi-byte characters.');
$node = $this->drupalCreateNode(array('title' => $title));
$this->drupalGet($node->urlInfo());
$result = $this->xpath('//span[contains(@class, "field-name-title")]');
$result = $this->xpath('//span[contains(@class, "field--name-title")]');
$this->assertEqual((string) $result[0], $title, 'The passed title was returned.');
}
......
......@@ -30,7 +30,7 @@
// Store the original value of this field. Necessary for reverting
// changes.
var $textElement;
var $fieldItems = this.$el.find('.field-item');
var $fieldItems = this.$el.find('.field__item');
if ($fieldItems.length) {
$textElement = this.$textElement = $fieldItems.eq(0);
}
......
......@@ -270,6 +270,36 @@ function rdf_preprocess_html(&$variables) {
}
}
/**
* Implements hook_preprocess_HOOK().
*
* @todo remove after https://www.drupal.org/node/2556785 is fixed.
*/
function rdf_preprocess_field__node(&$variables) {
// Just an empty hook to avoid https://www.drupal.org/node/2556785.
}
/**
* Implements hook_preprocess_HOOK() for UID field templates.
*/
function rdf_preprocess_field__node__uid(&$variables) {
_rdf_set_field_rel_attribute($variables);
}
/**
* Transforms the field property attribute into a rel attribute.
*/
function _rdf_set_field_rel_attribute(&$variables) {
// Swap the regular field property attribute and use the rel attribute
// instead so that it plays well with the RDFa markup when only a link is
// present in the field output, for example in the case of the uid field.
if (!empty($variables['attributes']['property'])) {
$variables['attributes']['rel'] = $variables['attributes']['property'];
unset($variables['attributes']['property']);
}
}
/**
* Implements hook_preprocess_HOOK() for node templates.
*/
......@@ -297,12 +327,6 @@ function rdf_preprocess_node(&$variables) {
);
}
// Adds RDFa markup for the relation between the node and its author.
$author_mapping = $mapping->getPreparedFieldMapping('uid');
if (!empty($author_mapping['properties']) && $variables['display_submitted']) {
$variables['author_attributes']['rel'] = $author_mapping['properties'];
}
// Adds RDFa markup for the date.
$created_mapping = $mapping->getPreparedFieldMapping('created');
if (!empty($created_mapping) && $variables['display_submitted']) {
......
......@@ -24,7 +24,7 @@ public function testIntegerFormatter() {
$this->assertFormatterRdfa(array('type' => 'number_integer'), 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is not created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]');
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
$this->assertFalse($result);
}
......@@ -32,6 +32,8 @@ public function testIntegerFormatter() {
* Tests the integer formatter with settings.
*/
public function testIntegerFormatterWithSettings() {
\Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save();
$this->fieldType = 'integer';
$formatter = array(
'type' => 'number_integer',
......@@ -50,7 +52,7 @@ public function testIntegerFormatterWithSettings() {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content=:testValue]', array(':testValue' => $testValue));
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', array(':testValue' => $testValue));
$this->assertTrue($result);
}
......@@ -65,7 +67,7 @@ public function testFloatFormatter() {
$this->assertFormatterRdfa(array('type' => 'number_unformatted'), 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is not created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]');
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
$this->assertFalse($result);
}
......@@ -73,6 +75,8 @@ public function testFloatFormatter() {
* Tests the float formatter with settings.
*/
public function testFloatFormatterWithSettings() {
\Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save();
$this->fieldType = 'float';
$formatter = array(
'type' => 'number_decimal',
......@@ -92,7 +96,7 @@ public function testFloatFormatterWithSettings() {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content=:testValue]', array(':testValue' => $testValue));
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', array(':testValue' => $testValue));
$this->assertTrue($result);
}
......@@ -113,7 +117,7 @@ public function testFloatFormatterWithScale() {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is not created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]');
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
$this->assertFalse($result);
}
......@@ -121,6 +125,8 @@ public function testFloatFormatterWithScale() {
* Tests the float formatter with a scale. Scale is exercised.
*/
public function testFloatFormatterWithScaleExercised() {
\Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save();
$this->fieldType = 'float';
$formatter = array(
'type' => 'number_decimal',
......@@ -134,7 +140,7 @@ public function testFloatFormatterWithScaleExercised() {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content=:testValue]', array(':testValue' => $testValue));
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', array(':testValue' => $testValue));
$this->assertTrue($result);
}
......@@ -149,7 +155,7 @@ public function testDecimalFormatter() {
$this->assertFormatterRdfa(array('type' => 'number_decimal'), 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is not created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]');
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
$this->assertFalse($result);
}
......@@ -157,6 +163,8 @@ public function testDecimalFormatter() {
* Tests the decimal formatter with settings.
*/
public function testDecimalFormatterWithSettings() {
\Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save();
$this->fieldType = 'decimal';
$formatter = array(
'type' => 'number_decimal',
......@@ -176,7 +184,7 @@ public function testDecimalFormatterWithSettings() {
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
// Test that the content attribute is created.
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content=:testValue]', array(':testValue' => $testValue));
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', array(':testValue' => $testValue));
$this->assertTrue($result);
}
......
......@@ -107,6 +107,10 @@ class StandardProfileTest extends WebTestBase {
protected function setUp() {
parent::setUp();
// Use Classy theme for testing markup output.
\Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save();
$this->baseUri = \Drupal::url('<front>', [], ['absolute' => TRUE]);
// Create two test users.
......
......@@ -69,7 +69,7 @@ function testSearchExcerpt() {
// The node body that will produce this rendered $text is:
// 123456789 HTMLTest +123456789+&lsquo; +&lsquo; +&lsquo; +&lsquo; +12345678 &nbsp;&nbsp; +&lsquo; +&lsquo; +&lsquo; &lsquo;
$text = "<div class=\"field field-name-body field-type-text-with-summary field-label-hidden\"><div class=\"field-items\"><div class=\"field-item even\" property=\"content:encoded\"><p>123456789 HTMLTest +123456789+‘ +‘ +‘ +‘ +12345678    +‘ +‘ +‘ ‘</p>\n</div></div></div> ";
$text = "<div class=\"field field--name-body field--type-text-with-summary field--label-hidden\"><div class=\"field__items\"><div class=\"field__item even\" property=\"content:encoded\"><p>123456789 HTMLTest +123456789+‘ +‘ +‘ +‘ +12345678    +‘ +‘ +‘ ‘</p>\n</div></div></div> ";
$result = $this->doSearchExcerpt('HTMLTest', $text);
$this->assertFalse(empty($result), 'Rendered Multi-byte HTML encodings are not corrupted in search excerpts');
}
......
......@@ -3,20 +3,23 @@
* Visual styles for fields.
*/
.field .field-label {
.field__label {
font-weight: bold;
}
.field-label-inline .field-label,
.field-label-inline .field-items {
float:left; /*LTR*/
margin-right: 0.5em; /*LTR*/
.field--label-inline .field__label,
.field--label-inline .field__items {
float: left; /*LTR*/
}
[dir="rtl"] .field-label-inline .field-label,
[dir="rtl"] .field-label-inline .field-items {
float: right;
margin-left: 0.5em;
margin-right: 0;
.field--label-inline .field__label,
.field--label-inline > .field__item,
.field--label-inline .field__items {
padding-right: 0.5em;
}
.field-label-inline .field-label::after {
[dir="rtl"] .field--label-inline .field__label,
[dir="rtl"] .field--label-inline .field__items {
padding-left: 0.5em;
padding-right: 0;
}
.field--label-inline .field__label::after {
content: ':';
}
......@@ -60,7 +60,7 @@ function testMultiForm() {
$field_name = 'field_ajax_test';
$form_xpath = '//form[starts-with(@id, "node-page-form")]';
$field_xpath = '//div[contains(@class, "field-name-field-ajax-test")]';
$field_xpath = '//div[contains(@class, "field--name-field-ajax-test")]';
$button_name = $field_name . '_add_more';
$button_value = t('Add another item');
$button_xpath_suffix = '//input[@name="' . $button_name . '"]';
......
......@@ -46,12 +46,9 @@ protected function setUp() {
*/
function testEntityViewController() {
$get_label_markup = function($label) {
return '<h1><div class="field field-entity-test--name field-name-name field-type-string field-label-hidden">
<div class="field-items">
<div class="field-item">' . $label . '</div>
</div>
</div>
</h1>';
return '<h1>
<div class="field field--name-name field--type-string field--label-hidden field__item">' . $label . '</div>
</h1>';
};
foreach ($this->entities as $entity) {
......
......@@ -97,7 +97,7 @@ function testPreserveFormActionAfterAJAX() {
// field items in the field for which we just added an item.
$this->drupalGet('node/add/page');
$this->drupalPostAjaxForm(NULL, array(), array('field_ajax_test_add_more' => t('Add another item')), NULL, array(), array(), 'node-page-form');
$this->assert(count($this->xpath('//div[contains(@class, "field-name-field-ajax-test")]//input[@type="text"]')) == 2, 'AJAX submission succeeded.');
$this->assert(count($this->xpath('//div[contains(@class, "field--name-field-ajax-test")]//input[@type="text"]')) == 2, 'AJAX submission succeeded.');
// Submit the form with the non-Ajax "Save" button, leaving the title field
// blank to trigger a validation error, and ensure that a validation error
......
{#
/**
* @file
* Default theme implementation for a field.
* Theme override for a field.
*
* To override output, copy the "field.html.twig" from the templates directory
* to your theme's directory and customize it, just like customizing other
......@@ -24,7 +24,7 @@
* - label_hidden: Whether to show the field label or not.
* - title_attributes: HTML attributes for the title.
* - label: The label for the field.
* - content_attributes: HTML attributes for the content.
* - multiple: TRUE if a field can contain multiple items.
* - items: List of all the field items. Each item contains:
* - attributes: List of HTML attributes for each item.
* - content: The field item's content.
......@@ -33,35 +33,34 @@
* - field_type: The type of the field.
* - label_display: The display settings for the label.
*
* @see template_preprocess_field()
*
* @ingroup themeable
* @see template_preprocess_field()
*/
#}
{% set field_name_class = field_name|clean_class %}
{%
set classes = [
'field',
'field-' ~ entity_type|clean_class ~ '--' ~ field_name_class,
'field-name-' ~ field_name_class,
'field-type-' ~ field_type|clean_class,
'field-label-' ~ label_display,
label_display == 'inline' ? 'clearfix',
]
%}
{%
set title_classes = [
'field-label',
label_display == 'visually_hidden' ? 'visually-hidden',
]
%}
<div{{ attributes.addClass(classes) }}>
{% if not label_hidden %}
<div{{ title_attributes.addClass(title_classes) }}>{{ label }}</div>
{% if label_hidden %}
{% if multiple %}
<div{{ attributes }}>
{% for item in items %}
<div{{ item.attributes }}>{{ item.content }}</div>
{% endfor %}
</div>
{% else %}
{% for item in items %}
<div{{ attributes }}>{{ item.content }}</div>
{% endfor %}
{% endif %}
<div{{ content_attributes.addClass('field-items') }}>
{% else %}
<div{{ attributes }}>
<div{{ title_attributes }}>{{ label }}</div>
{% if multiple %}
<div>
{% endif %}
{% for item in items %}
<div{{ item.attributes.addClass('field-item') }}>{{ item.content }}</div>
<div{{ item.attributes }}>{{ item.content }}</div>
{% endfor %}
{% if multiple %}
</div>
{% endif %}
</div>
</div>
{% endif %}
......@@ -339,12 +339,12 @@ function testTermInterface() {
$this->assertText($edit['description[0][value]'], 'The randomly generated term description is present.');
// Did this page request display a 'term-listing-heading'?
$this->assertTrue($this->xpath('//div[contains(@class, "field-taxonomy-term--description")]'), 'Term page displayed the term description element.');
$this->assertTrue($this->xpath('//div[contains(@class, "field--name-description")]'), 'Term page displayed the term description element.');
// Check that it does NOT show a description when description is blank.
$term->setDescription(NULL);
$term->save();
$this->drupalGet('taxonomy/term/' . $term->id());
$this->assertFalse($this->xpath('//div[contains(@class, "field-taxonomy-term--description")]'), 'Term page did not display the term description when description was blank.');
$this->assertFalse($this->xpath('//div[contains(@class, "field--entity-taxonomy-term--description")]'), 'Term page did not display the term description when description was blank.');
// Check that the description value is processed.
$value = $this->randomMachineName();
......
......@@ -400,7 +400,7 @@ public function testFieldClasses() {
$output = $view->preview();
$output = $renderer->renderRoot($output);
$this->assertFalse($this->xpathContent($output, '//div[contains(@class, :class)]', array(':class' => 'field-content')));
$this->assertFalse($this->xpathContent($output, '//div[contains(@class, :class)]', array(':class' => 'field-label')));
$this->assertFalse($this->xpathContent($output, '//div[contains(@class, :class)]', array(':class' => 'field__label')));
$id_field->options['element_default_classes'] = TRUE;
$output = $view->preview();
......
......@@ -29,8 +29,8 @@
.comment__attribution img {
border: 1px solid #d3d7d9;
}
/* This is required to win over specificity of .field-type-image img */
.comment .field-name-user-picture img {
/* This is required to win over specificity of .field--type-image img */
.comment .field--name-user-picture img {
margin: 0;
}
.comment__author .username {
......
......@@ -3,93 +3,93 @@
* Visual styles for Bartik's field components.
*/
.field-type-taxonomy-term-reference {
.field--type-entity-reference {
margin: 0 0 1.2em;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.field-type-taxonomy-term-reference .field-label {
.field--type-entity-reference .field__label {
font-weight: normal;
margin: 0;
padding-right: 5px; /* LTR */
}
[dir="rtl"] .field-type-taxonomy-term-reference .field-label {
[dir="rtl"] .field--type-entity-reference .field__label {
padding-left: 5px;
padding-right: 0;
}
.field-type-taxonomy-term-reference .field-label,
.field-type-taxonomy-term-reference ul.links {
.field--type-entity-reference .field__label,
.field--type-entity-reference ul.links {
font-size: 0.8em;
}
.node--view-mode-teaser .field-type-taxonomy-term-reference .field-label,
.node--view-mode-teaser .field-type-taxonomy-term-reference ul.links {
.node--view-mode-teaser .field--type-entity-reference .field__label,
.node--view-mode-teaser .field--type-entity-reference ul.links {
font-size: 0.821em;
}
.field-type-taxonomy-term-reference ul.links {
.field--type-entity-reference ul.links {
padding: 0;
margin: 0;
list-style: none;
}
.field-type-taxonomy-term-reference ul.links li {
.field--type-entity-reference ul.links li {
float: left; /* LTR */
padding: 0 1em 0 0; /* LTR */
white-space: nowrap;
}
[dir="rtl"] .field-type-taxonomy-term-reference ul.links li {
[dir="rtl"] .field--type-entity-reference ul.links li {
padding: 0 0 0 1em;
float: right;
}
@media all and (min-width: 560px) {
.node .field-type-image {
.node .field--type-image {
float: left; /* LTR */
margin: 0 1em 0 0; /* LTR */
}
[dir="rtl"] .node .field-type-image {
[dir="rtl"] .node .field--type-image {
float: right;
margin: 0 0 0 1em;
}
.node .field-type-image + .field-type-image {
.node .field--type-image + .field--type-image {
clear: both;
}
}
.field-type-image img,
.field-name-field-user-picture img {
.field--type-image img,
.field--name-field-user-picture img {
margin: 0 0 1em;
}
.field-type-image a {
.field--type-image a {
border-bottom: none;
}
.field-name-field-tags {
.field--name-field-tags {
margin: 0 0 1.2em;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.field-name-field-tags .field-label {
.field--name-field-tags .field__label {
font-weight: normal;
margin: 0;
padding-right: 5px; /* LTR */
}
[dir="rtl"] .field-name-field-tags .field-label {
[dir="rtl"] .field--name-field-tags .field__label {
padding-left: 5px;
padding-right: 0;
}
.field-name-field-tags .field-label,
.field-name-field-tags ul.links {
.field--name-field-tags .field__label,
.field--name-field-tags ul.links {
font-size: 0.8em;
}
.node--view-mode-teaser .field-name-field-tags .field-label,
.node--view-mode-teaser .field-name-field-tags ul.links {
.node--view-mode-teaser .field--name-field-tags .field__label,
.node--view-mode-teaser .field--name-field-tags ul.links {
font-size: 0.821em;
}
.field-name-field-tags ul.links {
.field--name-field-tags ul.links {
padding: 0;
margin: 0;
list-style: none;
}
.field-name-field-tags ul.links li {
.field--name-field-tags ul.links li {
float: left; /* LTR */
padding: 0 1em 0 0; /* LTR */
white-space: nowrap;
}
[dir="rtl"] .field-name-field-tags ul.links li {
[dir="rtl"] .field--name-field-tags ul.links li {
padding: 0 0 0 1em;
float: right;
}
......@@ -40,11 +40,11 @@
color: #68696b;
margin-bottom: -5px;
}
.node__meta .field-name-field-user-picture img {
.node__meta .field--name-field-user-picture img {
float: left; /* LTR */
margin: 1px 20px 0 0; /* LTR */
}
[dir="rtl"] .node__meta .field-name-field-user-picture img {
[dir="rtl"] .node__meta .field--name-field-user-picture img {
float: right;
margin-left: 20px;
margin-right: 0;
......
......@@ -21,20 +21,18 @@
* @see bartik_preprocess_field()
*/
#}
{% set field_name_class = field_name|clean_class %}
{%
set classes = [
'field',
'field-' ~ entity_type|clean_class ~ '--' ~ field_name_class,
'field-name-' ~ field_name_class,
'field-type-' ~ field_type|clean_class,
'field-label-' ~ label_display,
'field--name-' ~ field_name|clean_class,
'field--type-' ~ field_type|clean_class,
'field--label-' ~ label_display,
'clearfix',
]
%}
{%
set title_classes = [
'field-label',
'field__label',
label_display == 'inline' ? 'inline',
]
%}
......@@ -42,7 +40,7 @@