The FlexiStyle theme is a base theme. This theme supports the Drupal 9 and 10 versions. In this theme, we have disabled all the system CSS. This theme is lightweight because we are attaching all the CSS and JS libraries based on the components and disabling unnecessary libraries. Use twigs from the system modules for the alteration. We have created all the recommended twigs in the templates folder. The theme is fully responsive and mobile-first. In this theme, we have added the latest version of the font-awesome and Google material library for icons.
Default core block configuration files are added in the optional config folder in the theme. We can manage the header and footer color and style from the theme. It is a user-friendly theme. The theme is fully PWA compatible. The theme performance is very high in the lighthouse.

Create a Subtheme

  1. You can create a subtheme through a shell script.
  2. Install the FlexiStyle theme with the composer composer require 'drupal/flexi_style' but don't enable it.
  3. Go to the theme folder from shell or command prompt: cd themes/contrib/flexi_style.
  4. Run this command from the shell "Make script executable": chmod +x scripts/subtheme.sh.
  5. Run this command from the shell to launch the script: sh scripts/subtheme.sh or ./scripts/subtheme.sh.
  6. That script will ask the questions for you to create your subtheme.
    • Type machine_name of the theme: my_theme
    • Type Name of the theme: My Theme
  7. Go to the administration -> Appearance and enable the My Theme.

Project link

https://www.drupal.org/project/flexi_style

CommentFileSizeAuthor
#6 flexi_style-phpcs.txt469.25 KBvishal.kadam

Comments

anoopsingh92 created an issue. See original summary.

vishal.kadam’s picture

Thank you for applying!

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

The important notes are the following.

  • If you have not done it yet, you should run phpcs --standard=Drupal,DrupalPractice on the project, which alone fixes most of what reviewers would report.
  • For the time this application is open, only your commits are allowed.
  • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status will not be changed by this application; once this application is closed, you will be able to change the project status from Not covered to Opt into security advisory coverage. This is possible only 14 days after the project is created.
    Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage.
  • Only the person who created the application will get the permission to opt projects into security advisory coverage. No other person will get the same permission from the same application; that applies also to co-maintainers/maintainers of the project used for the application.
  • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

To the reviewers

Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.

The important notes are the following.

  • It is preferable to wait for a project moderator before posting the first comment on newly created applications. Project moderators will do some preliminary checks that are necessary before any change on the project files is suggested.
  • Reviewers should show the output of a CLI tool only once per application.
  • It may be best to have the applicant fix things before further review.

For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.

anoopsingh92’s picture

Title: [1.2.x] FlexiStyle - The project is not covered by Drupal’s security advisory policy » [1.2.x] FlexiStyle
vishal.kadam’s picture

Issue summary: View changes

Remember to change status, when the project is ready to be reviewed. In this queue, projects are only reviewed when the status is Needs review.

anoopsingh92’s picture

Status: Active » Needs review

Drupal coding standard fixes are done.

vishal.kadam’s picture

Status: Needs review » Needs work
StatusFileSize
new469.25 KB

1. Fix phpcs issues.

It seems you have missed working on the coding standards of CSS files.(see attached flexi_style-phpcs.txt)

2. Remove empty hooks.

FILE: flexi_style.theme

/**
 * Implements hook_preprocess_HOOK() for node.html.twig.
 */
function flexi_style_preprocess_node(array &$variables): void {

}
/**
 * Implements hook_preprocess_region() for region.html.twig.
 */
function flexi_style_preprocess_region(array &$variables): void {

}
/**
 * Implements hook_preprocess_block() for block.html.twig.
 */
function flexi_style_preprocess_block(array &$variables): void {

}
/**
 * Implements hook_preprocess_breadcrumb().
 */
function flexi_style_preprocess_breadcrumb(array &$variables): void {

}

FILE: subtheme/_flexi_style_subtheme.theme

/**
 * Implements hook_preprocess_HOOK() for html.html.twig.
 */
function flexi_style_subtheme_preprocess_html(array &$variables): void {

}
/**
 * Implements hook_preprocess_HOOK() for page.html.twig.
 */
function flexi_style_subtheme_preprocess_page(array &$variables): void {

}
/**
 * Implements hook_preprocess_HOOK() for node.html.twig.
 */
function flexi_style_subtheme_preprocess_node(array &$variables): void {

}
anoopsingh92’s picture

Status: Needs work » Needs review

Thanks for the review @vishal.kadam, I think, I missed it for the CSS files.
Now, I have fixed all the mentioned issues, you can check and review them.
Thanks.

vishal.kadam’s picture

Rest looks fine to me.

Let’s wait for a Code Review Administrator to take a look and if everything goes fine, you will get the role.

vishal.kadam’s picture

Status: Needs review » Reviewed & tested by the community
avpaderno’s picture

Status: Reviewed & tested by the community » Needs work
  • The following points are just a start and don't necessarily encompass all of the changes that may be necessary
  • A specific point may just be an example and may apply in other places
  • A review is about code that doesn't follow the coding standards, contains possible security issue, or does not correctly use the Drupal API; the single points are not ordered, not even by importance

flexi_style.theme

/**
 * Implements hook_preprocess_html() for html.html.twig.
 */
function flexi_style_preprocess_html(array &$variables): void {
  // Header settings.
  $variables['header_position'] = theme_get_setting('header_position');

  // Global settings.
  $variables['fs_fonts'] = theme_get_setting('fs_fonts');
  $variables['fs_icons'] = theme_get_setting('fs_icons');
  $variables['global_style'] = theme_get_setting('global_style');
}

/**
 * Implements hook_preprocess_page() for page.html.twig.
 */
function flexi_style_preprocess_page(array &$variables): void {
  // Top Header settings.
  $variables['top_header_bg'] = theme_get_setting('top_header_bg');
  $variables['top_header_classes'] = theme_get_setting('top_header_classes');

  // Header settings.
  $variables['header_style'] = theme_get_setting('header_style');
  $variables['header_navbar_bg'] = theme_get_setting('header_navbar_bg');
  $variables['header_classes'] = theme_get_setting('header_classes');

  // Footer settings.
  $variables['footer_bg'] = theme_get_setting('footer_bg');
  $variables['footer_classes'] = theme_get_setting('footer_classes');
  $variables['footer_bottom_bg'] = theme_get_setting('footer_bottom_bg');
  $variables['footer_bottom_classes'] = theme_get_setting('footer_bottom_classes');

  // Global settings.
  $variables['fs_icons'] = theme_get_setting('fs_icons');
  if ($variables['fs_icons'] == 'fontawesome') {
    $variables['#attached']['library'][] = 'flexi_style/fontawesome';
  }
  elseif ($variables['fs_icons'] == 'google-material') {
    $variables['#attached']['library'][] = 'flexi_style/google_material';
  }
}

The correct description for those hook implementations starts with Implements hook_preprocess_HOOK() for.

  if ([$form_id, ['search_form']]) {
    $form['keys']['#attributes']['placeholder'] = t('Enter search terms...');
  }

With that code, $form['keys']['#attributes']['placeholder'] will be set for every form.

  if ($form_id == 'user_pass') {
    $form['name']['#description'] = t('Password reset instructions will be sent to your registered email address.');
  }

Drupal core already adds a similar description for the mail form element.

$form['mail'] = [
  '#prefix' => '<p>',
  '#markup' => $this->t('Password reset instructions will be mailed to %email. You must log out to use the password reset link in the email.', ['%email' => $user->getEmail()]),
  '#suffix' => '</p>',
];

It does not make sense to add a similar sentence to the name form element.

  if ($form_id == 'user_register_form') {
    $form['actions']['submit']['#value'] = t('Register');
  }

That form is also used from users with the role of user administrator, for which the more correct label for the submission button is Create new account, already used from Drupal core.

/**
 * Implements hook_theme_suggestions_alter().
 */
function flexi_style_theme_suggestions_alter(array &$suggestions, array &$variables, $hook): void {
  if ($hook == 'form' & !empty($variables['element']['#id'])) {
    $suggestions[] = 'form__' . str_replace('-', '_', $variables['element']['#id']);
  }
}

Since that hook is adding suggestions only for a case, that hook should be replaced by a hook_theme_suggestions_HOOK_alter().

/**
 * Implements hook_theme_suggestions_user_alter().
 */
function flexi_style_theme_suggestions_user_alter(array &$suggestions, array &$variables): void {
  $view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
  $suggestions[] = 'user__' . $view_mode;
  $current_user = $variables['elements']['#user'];
  $roles = $current_user->getRoles();
  foreach ($roles as $role) {
    $suggestions[] = 'user__' . $view_mode . '__' . $role;
  }
}

/**
 * Implements hook_theme_suggestions_page_alter().
 */
function flexi_style_theme_suggestions_page_alter(array &$suggestions, array $variables) {
  if ($node = \Drupal::routeMatch()->getParameter('node')) {
    $suggestions[] = 'page__' . $node->bundle();
  }
}

Those are hook_theme_suggestions_HOOK_alter() implementations.

anoopsingh92’s picture

Status: Needs work » Needs review

Thanks for the feedback @apaderno,
I worked on your mentioned comment #10.

I have updated the file flexi_style.theme please review it again.

Thank you

anoopsingh92’s picture

Title: [1.2.x] FlexiStyle » [1.3.x] FlexiStyle

The code is updated and the branch has also changed.
Please review it now. Thanks.

rushikesh raval’s picture

Priority: Normal » Major

I am changing the issue priority as per issue priorities.

avpaderno’s picture

Priority: Major » Normal
Status: Needs review » Reviewed & tested by the community

flexi_style.theme

  $variables['icons'] = $icons = theme_get_setting('icons');
  $variables['container'] = $container = theme_get_setting('container');

  // Theme setting variables for Top Header.
  $variables['top_header_bg'] = $top_header_bg = theme_get_setting('top_header_bg');
  $variables['top_header_classes'] = $top_header_classes = theme_get_setting('top_header_classes');

  // Theme setting variables for Header.
  $variables['header_style'] = $header_style = theme_get_setting('header_style');
  $variables['header_navbar_bg'] = $header_navbar_bg = theme_get_setting('header_navbar_bg');
  $variables['header_classes'] = $header_classes = theme_get_setting('header_classes');

  // Theme setting variables for Footer.
  $variables['footer_bg'] = $footer_bg = theme_get_setting('footer_bg');
  $variables['footer_classes'] = $footer_classes = theme_get_setting('footer_classes');
  $variables['footer_bottom_bg'] = $footer_bottom_bg = theme_get_setting('footer_bottom_bg');
  $variables['footer_bottom_classes'] = $footer_bottom_classes = theme_get_setting('footer_bottom_classes');

With the exception of $variables, all the variables are initialized but never used.

Thank you for your contribution!
I updated your account so you can now opt into security advisory coverage for any project you created and every project you will create.

These are some recommended readings to help you with maintainership:

You can find more contributors chatting on Slack or IRC in #drupal-contribute. So, come hang out and stay involved!

Thank you for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank also the dedicated reviewers as well.

avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.