Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding breakpoint for large desktops #3

Merged
merged 1 commit into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Element/GridStart.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function generate()
public static function getColumnsConfiguration(array $data): array
{
$config = [];
foreach (['desktop', 'tablet', 'mobile'] as $media) {
foreach (['largedesktop', 'desktop', 'tablet', 'mobile'] as $media) {
if (isset($data['cp_grid_' . $media])) {
$columns = preg_replace(
'/grid/',
Expand Down
43 changes: 39 additions & 4 deletions src/Resources/contao/dca/tl_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,45 @@
$GLOBALS['TL_CSS'][] = 'bundles/contaoclickpressgrid/be_main.css';
}

$GLOBALS['TL_DCA']['tl_content']['palettes']['cp_grid_start'] = '{type_legend},type,headline;{cp_grid_legend},cp_grid_mobile,cp_grid_tablet,cp_grid_desktop;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID;{invisible_legend:hide},invisible,start,stop';
$GLOBALS['TL_DCA']['tl_content']['palettes']['cp_grid_start'] = '{type_legend},type,headline;{cp_grid_legend},cp_grid_mobile,cp_grid_tablet,cp_grid_desktop,cp_grid_largedesktop;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID;{invisible_legend:hide},invisible,start,stop';
$GLOBALS['TL_DCA']['tl_content']['palettes']['cp_grid_stop'] = '{type_legend},type;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop';
$GLOBALS['TL_DCA']['tl_content']['palettes']['cp_column_start'] = '{type_legend},type,headline;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID;{invisible_legend:hide},invisible,start,stop';
$GLOBALS['TL_DCA']['tl_content']['palettes']['cp_column_stop'] = '{type_legend},type;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop';

$GLOBALS['TL_DCA']['tl_content']['fields']['cp_grid_largedesktop'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['cp_grid_largedesktop'],
'inputType' => 'select',
'options' => array(
'grid_100',
'grid_50_50',
'grid_33_33_33',
'grid_25_25_25_25',
'grid_20_20_20_20_20',
'grid_75_25',
'grid_25_75',
'grid_66_33',
'grid_33_66',
'grid_50_25_25',
'grid_25_50_25',
'grid_25_25_50',
'grid_40_30_30',
'grid_30_40_30',
'grid_30_30_40',
'grid_20_40_40',
'grid_40_20_40',
'grid_40_40_20',
'grid_40_20_20_20',
'grid_20_40_20_20',
'grid_20_20_40_20',
'grid_20_20_20_40',
),
'reference' => &$GLOBALS['TL_LANG']['tl_content']['cp_grid_options'],
'eval' => array(
'tl_class' => 'cp_grid_w50',
),
'sql' => "varchar(255) NOT NULL default ''",
);

$GLOBALS['TL_DCA']['tl_content']['fields']['cp_grid_desktop'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['cp_grid_desktop'],
'inputType' => 'select',
Expand Down Expand Up @@ -45,7 +80,7 @@
),
'reference' => &$GLOBALS['TL_LANG']['tl_content']['cp_grid_options'],
'eval' => array(
'tl_class' => 'cp_grid_w33',
'tl_class' => 'cp_grid_w50',
),
'sql' => "varchar(255) NOT NULL default ''",
);
Expand Down Expand Up @@ -75,7 +110,7 @@
),
'reference' => &$GLOBALS['TL_LANG']['tl_content']['cp_grid_options'],
'eval' => array(
'tl_class' => 'cp_grid_w33',
'tl_class' => 'cp_grid_w50',
),
'sql' => "varchar(255) NOT NULL default ''",
);
Expand All @@ -102,7 +137,7 @@
),
'reference' => &$GLOBALS['TL_LANG']['tl_content']['cp_grid_options'],
'eval' => array(
'tl_class' => 'cp_grid_w33',
'tl_class' => 'cp_grid_w50',
),
'sql' => "varchar(255) NOT NULL default ''",
);
1 change: 1 addition & 0 deletions src/Resources/contao/languages/de/tl_content.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
$GLOBALS['TL_LANG']['tl_content']['cp_grid_largedesktop'] = ['Desktop XL', 'Spaltenanzahl auf großen Desktops'];
$GLOBALS['TL_LANG']['tl_content']['cp_grid_desktop'] = ['Desktop', 'Spaltenanzahl in der Desktopansicht'];
$GLOBALS['TL_LANG']['tl_content']['cp_grid_tablet'] = ['Tablet', 'Spaltenanzahl in der Tabletansicht'];
$GLOBALS['TL_LANG']['tl_content']['cp_grid_mobile'] = ['Mobile', 'Spaltenanzahl in der Mobilansicht'];
Expand Down
1 change: 1 addition & 0 deletions src/Resources/contao/languages/en/tl_content.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
$GLOBALS['TL_LANG']['tl_content']['cp_grid_largedesktop'] = ['Desktop XL', 'Set columns in large desktop view'];
$GLOBALS['TL_LANG']['tl_content']['cp_grid_desktop'] = ['Desktop', 'Set columns in desktop view'];
$GLOBALS['TL_LANG']['tl_content']['cp_grid_tablet'] = ['Tablet', 'Set columns in tablet view'];
$GLOBALS['TL_LANG']['tl_content']['cp_grid_mobile'] = ['Mobile', 'Set columns in mobile view'];
Expand Down
6 changes: 3 additions & 3 deletions src/Resources/public/be_main.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

.cp_grid_w33 {
.cp_grid_w50 {
float: left;
width: 29%;
width: 46%;
height: 72px;
}
.cp_grid_w33 select {
.cp_grid_w50 select {
width: 90%;
}
103 changes: 103 additions & 0 deletions src/Resources/public/clickpress-grid.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 76 additions & 3 deletions src/Resources/public/clickpress-grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,79 @@ $mq_extra: 1260px; // Extra large devices (large desktops, 1260px and up)
}

@media (min-width: $mq_extra) {

}

.grid_largedesktop_100 {
grid-template-columns: 1fr;
}
.grid_largedesktop_50_50 {
grid-template-columns: repeat(2, 1fr);
}
.grid_largedesktop_50_25_25 {
grid-template-columns: 2fr 1fr 1fr;
}
.grid_largedesktop_33_33_33 {
grid-template-columns: repeat(3, 1fr);
}
.grid_largedesktop_75_25 {
grid-template-columns: 3fr 1fr;
}
.grid_largedesktop_25_75 {
grid-template-columns: 1fr 3fr;
}
.grid_largedesktop_66_33 {
grid-template-columns: 2fr 1fr;
}
.grid_largedesktop_33_66 {
grid-template-columns: 1fr 2fr;
}
.grid_largedesktop_50_25_25 {
grid-template-columns: 2fr 1fr 1fr;
}
.grid_largedesktop_40_30_30 {
grid-template-columns: 4fr 3fr 3fr;
}
.grid_largedesktop_50_25_25 {
grid-template-columns: 2fr 1fr 1fr;
}
.grid_largedesktop_25_50_25 {
grid-template-columns: 1fr 2fr 1fr;
}
.grid_largedesktop_25_25_50 {
grid-template-columns: 1fr 1fr 2fr;
}
.grid_largedesktop_40_30_30 {
grid-template-columns: 4fr 3fr 3fr;
}
.grid_largedesktop_30_40_30 {
grid-template-columns: 3fr 4fr 3fr;
}
.grid_largedesktop_30_30_40 {
grid-template-columns: 3fr 3fr 4fr;
}
.grid_largedesktop_20_40_40 {
grid-template-columns: 1fr 2fr 2fr;
}
.grid_largedesktop_40_20_40 {
grid-template-columns: 2fr 1fr 2fr;
}
.grid_largedesktop_40_40_20 {
grid-template-columns: 2fr 2fr 1fr;
}
.grid_largedesktop_25_25_25_25 {
grid-template-columns: repeat(4, 1fr);
}
.grid_largedesktop_40_20_20_20 {
grid-template-columns: 2fr 1fr 1fr 1fr;
}
.grid_largedesktop_20_40_20_20 {
grid-template-columns: 1fr 2fr 1fr 1fr;
}
.grid_largedesktop_20_20_40_20 {
grid-template-columns: 1fr 1fr 2fr 1fr;
}
.grid_largedesktop_20_20_20_40 {
grid-template-columns: 1fr 1fr 1fr 2fr;
}
.grid_largedesktop_20_20_20_20_20 {
grid-template-columns: repeat(5, 1fr);
}
}